Resolves: tdf#150926 Add-In result svl::SharedString needs to be interned
Change-Id: If582e7e1bf818dcf9eaddd5313aa21f5768a578f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139886 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
This commit is contained in:
@@ -44,6 +44,7 @@ class SfxObjectShell;
|
||||
class ScUnoAddInFuncData;
|
||||
class ScFuncDesc;
|
||||
class LanguageTag;
|
||||
class ScDocument;
|
||||
|
||||
typedef std::unordered_map< OUString, const ScUnoAddInFuncData* > ScAddInHashMap;
|
||||
|
||||
@@ -198,6 +199,7 @@ private:
|
||||
css::uno::Sequence<css::uno::Any> aArgs;
|
||||
css::uno::Sequence<css::uno::Any> aVarArg;
|
||||
css::uno::Reference<css::uno::XInterface> xCaller;
|
||||
ScDocument& mrDoc;
|
||||
bool bValidCount;
|
||||
// result:
|
||||
FormulaError nErrCode;
|
||||
@@ -211,7 +213,7 @@ private:
|
||||
|
||||
public:
|
||||
// exact name
|
||||
ScUnoAddInCall( ScUnoAddInCollection& rColl, const OUString& rName,
|
||||
ScUnoAddInCall( ScDocument& rDoc, ScUnoAddInCollection& rColl, const OUString& rName,
|
||||
tools::Long nParamCount );
|
||||
~ScUnoAddInCall();
|
||||
|
||||
|
@@ -61,6 +61,7 @@
|
||||
#include <svl/sharedstring.hxx>
|
||||
#include <formulaopt.hxx>
|
||||
#include <compiler.hxx>
|
||||
#include <document.hxx>
|
||||
#include <memory>
|
||||
|
||||
using namespace com::sun::star;
|
||||
@@ -1283,8 +1284,9 @@ bool ScUnoAddInCollection::FillFunctionDescFromData( const ScUnoAddInFuncData& r
|
||||
return true;
|
||||
}
|
||||
|
||||
ScUnoAddInCall::ScUnoAddInCall( ScUnoAddInCollection& rColl, const OUString& rName,
|
||||
ScUnoAddInCall::ScUnoAddInCall( ScDocument& rDoc, ScUnoAddInCollection& rColl, const OUString& rName,
|
||||
tools::Long nParamCount ) :
|
||||
mrDoc( rDoc ),
|
||||
bValidCount( false ),
|
||||
nErrCode( FormulaError::NoCode ), // before function was called
|
||||
bHasString( true ),
|
||||
@@ -1637,13 +1639,13 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes )
|
||||
for (sal_Int32 nCol=0; nCol<nColCount; nCol++)
|
||||
{
|
||||
xMatrix->PutString(
|
||||
svl::SharedString(pColArr[nCol]),
|
||||
mrDoc.GetSharedStringPool().intern(pColArr[nCol]),
|
||||
static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow));
|
||||
}
|
||||
for (sal_Int32 nCol=nColCount; nCol<nMaxColCount; nCol++)
|
||||
{
|
||||
xMatrix->PutString(
|
||||
svl::SharedString(OUString()),
|
||||
svl::SharedString::getEmptyString(),
|
||||
static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow));
|
||||
}
|
||||
}
|
||||
|
@@ -2734,7 +2734,7 @@ void ScInterpreter::ScExternal()
|
||||
// bLocalFirst=false in FindFunction, cFunc should be the stored
|
||||
// internal name
|
||||
|
||||
ScUnoAddInCall aCall( *ScGlobal::GetAddInCollection(), aUnoName, nParamCount );
|
||||
ScUnoAddInCall aCall( mrDoc, *ScGlobal::GetAddInCollection(), aUnoName, nParamCount );
|
||||
|
||||
if ( !aCall.ValidParamCount() )
|
||||
SetError( FormulaError::IllegalParameter );
|
||||
|
Reference in New Issue
Block a user