summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-10 10:28:35 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-11 12:14:26 -0400
commit6255be7ca294d350143290c343673f264f42220c (patch)
treed06af06d9d0ef010fac2fcb0822aa9f3bfcfabfd /sc
parent7c6848845f10dbac392bfc3dccf405d8e8e969fc (diff)
GetString() from ScMatrix to return SharedString.
And adjust all its call sites. Change-Id: Ibb0c754e8fa105bd1a6035f2e0df5cee2d8491c4
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/scmatrix.hxx8
-rw-r--r--sc/source/core/data/dociter.cxx16
-rw-r--r--sc/source/core/data/formulacell.cxx2
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/doubleref.cxx4
-rw-r--r--sc/source/core/tool/interpr1.cxx49
-rw-r--r--sc/source/core/tool/interpr4.cxx6
-rw-r--r--sc/source/core/tool/interpr5.cxx8
-rw-r--r--sc/source/core/tool/rangeseq.cxx6
-rw-r--r--sc/source/core/tool/scmatrix.cxx36
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx3
11 files changed, 70 insertions, 70 deletions
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 61112171fd94..b9975063e756 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -276,15 +276,15 @@ public:
double GetDouble( SCSIZE nIndex) const;
/// @return empty string if empty or empty path, else string content.
- OUString GetString( SCSIZE nC, SCSIZE nR) const;
+ svl::SharedString GetString( SCSIZE nC, SCSIZE nR) const;
/// @return empty string if empty or empty path, else string content.
- OUString GetString( SCSIZE nIndex) const;
+ svl::SharedString GetString( SCSIZE nIndex) const;
/** @returns the matrix element's string if one is present, otherwise the
numerical value formatted as string, or in case of an error the error
string is returned; an empty string for empty, a "FALSE" string for
empty path. */
- OUString GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const;
+ svl::SharedString GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const;
/// @ATTENTION: If bString the ScMatrixValue->pS may still be NULL to indicate
/// an empty string!
@@ -337,7 +337,7 @@ public:
IterateResult Product(bool bTextAsZero) const;
size_t Count(bool bCountStrings) const;
size_t MatchDoubleInColumns(double fValue, size_t nCol1, size_t nCol2) const;
- size_t MatchStringInColumns(const OUString& rStr, size_t nCol1, size_t nCol2) const;
+ size_t MatchStringInColumns(const svl::SharedString& rStr, size_t nCol1, size_t nCol2) const;
double GetMaxValue( bool bTextAsZero ) const;
double GetMinValue( bool bTextAsZero ) const;
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 3cad91c00e2c..eaa496ac6ce6 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -553,7 +553,7 @@ bool ScDBQueryDataIterator::DataAccessMatrix::getCurrent(Value& rValue)
if (isValidQuery(mnCurRow, rMat))
{
- rValue.maString = rMat.GetString(mpParam->mnField, mnCurRow);
+ rValue.maString = rMat.GetString(mpParam->mnField, mnCurRow).getString();
rValue.mfValue = rMat.GetDouble(mpParam->mnField, mnCurRow);
rValue.mbIsNumber = !bIsStrVal;
rValue.mnError = 0;
@@ -681,19 +681,19 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM
do
{
// Equality check first.
- OUString aMatStr = rMat.GetString(nField, nRow);
- upperCase(aMatStr);
- OUString aQueryStr = rEntry.GetQueryItem().maString.getString();
- upperCase(aQueryStr);
+ svl::SharedString aMatStr = rMat.GetString(nField, nRow);
+ svl::SharedString aQueryStr = rEntry.GetQueryItem().maString;
bool bDone = false;
+ rtl_uString* p1 = mpParam->bCaseSens ? aMatStr.getData() : aMatStr.getDataIgnoreCase();
+ rtl_uString* p2 = mpParam->bCaseSens ? aQueryStr.getData() : aQueryStr.getDataIgnoreCase();
switch (rEntry.eOp)
{
case SC_EQUAL:
- bValid = aMatStr.equals(aQueryStr);
+ bValid = (p1 == p2);
bDone = true;
break;
case SC_NOT_EQUAL:
- bValid = !aMatStr.equals(aQueryStr);
+ bValid = (p1 != p2);
bDone = true;
break;
default:
@@ -704,7 +704,7 @@ bool ScDBQueryDataIterator::DataAccessMatrix::isValidQuery(SCROW nRow, const ScM
break;
// Unequality check using collator.
- sal_Int32 nCompare = rCollator.compareString(aMatStr, aQueryStr);
+ sal_Int32 nCompare = rCollator.compareString(aMatStr.getString(), aQueryStr.getString());
switch (rEntry.eOp)
{
case SC_LESS :
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 472c208df81b..498c1aa2b434 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1778,7 +1778,7 @@ void ScFormulaCell::GetURLResult( OUString& rURL, OUString& rCellText )
{
// determine if the matrix result is a string or value.
if (!xMat->IsValue(0, 1))
- rURL = xMat->GetString(0, 1);
+ rURL = xMat->GetString(0, 1).getString();
else
pFormatter->GetOutputString(
xMat->GetDouble(0, 1), nURLFormat, rURL, &pColor);
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index ac8b6480d88d..c64c98f1c4cd 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4168,7 +4168,7 @@ void ScCompiler::CreateStringFromMatrix( OUStringBuffer& rBuffer,
else if( pMatrix->IsEmpty( nC, nR ) )
;
else if( pMatrix->IsString( nC, nR ) )
- AppendString( rBuffer, pMatrix->GetString( nC, nR ) );
+ AppendString( rBuffer, pMatrix->GetString(nC, nR).getString() );
}
}
rBuffer.append( mxSymbols->getSymbol(ocArrayClose) );
diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx
index 348380968564..0c1d5e6b4b6c 100644
--- a/sc/source/core/tool/doubleref.cxx
+++ b/sc/source/core/tool/doubleref.cxx
@@ -429,7 +429,7 @@ OUString ScDBExternalRange::getString(SCCOL nCol, SCROW nRow) const
if (nCol >= mnCols || nRow >= mnRows)
return OUString();
- return mpMatrix->GetString(nCol, nRow);
+ return mpMatrix->GetString(nCol, nRow).getString();
}
SCCOL ScDBExternalRange::getFirstFieldColumn() const
@@ -451,7 +451,7 @@ SCCOL ScDBExternalRange::findFieldColumn(const OUString& rStr, sal_uInt16* pErr)
lcl_uppercase(aUpper);
for (SCCOL i = 0; i < mnCols; ++i)
{
- OUString aUpperVal = mpMatrix->GetString(i, 0);
+ OUString aUpperVal = mpMatrix->GetString(i, 0).getString();
lcl_uppercase(aUpperVal);
if (aUpper.equals(aUpperVal))
return i;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 520ef1f71a6f..4bf9e4a8d430 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -249,7 +249,7 @@ void ScInterpreter::ScIfJump()
is the result matrix of a jump matrix. All arguments must be valid and are
not checked. */
static void lcl_storeJumpMatResult(
- svl::SharedStringPool& rPool, const ScMatrix* pMat, ScMatrix* pResMat, SCSIZE nC, SCSIZE nR )
+ const ScMatrix* pMat, ScMatrix* pResMat, SCSIZE nC, SCSIZE nR )
{
if ( pMat->IsValue( nC, nR ) )
{
@@ -262,8 +262,7 @@ static void lcl_storeJumpMatResult(
}
else
{
- const OUString& rStr = pMat->GetString(nC, nR);
- pResMat->PutString(rPool.intern(rStr), nC, nR);
+ pResMat->PutString(pMat->GetString(nC, nR), nC, nR);
}
}
@@ -380,7 +379,7 @@ void ScInterpreter::ScIfError( bool bNAonly )
{
for ( ; nR < nRows && (nC != nErrorCol || nR != nErrorRow); ++nR)
{
- lcl_storeJumpMatResult(mrStrPool, pMatPtr, pResMatPtr, nC, nR);
+ lcl_storeJumpMatResult(pMatPtr, pResMatPtr, nC, nR);
}
if (nC != nErrorCol || nR != nErrorRow)
++nC;
@@ -397,7 +396,7 @@ void ScInterpreter::ScIfError( bool bNAonly )
}
else
{ // FALSE, EMPTY path, store result instead
- lcl_storeJumpMatResult(mrStrPool, pMatPtr, pResMatPtr, nC, nR);
+ lcl_storeJumpMatResult(pMatPtr, pResMatPtr, nC, nR);
}
}
}
@@ -746,7 +745,7 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
}
else
{
- lcl_storeJumpMatResult(mrStrPool, pMat.get(), pResMat.get(), nC, nR);
+ lcl_storeJumpMatResult(pMat.get(), pResMat.get(), nC, nR);
}
lcl_AdjustJumpMatrix( pJumpMatrix, pResMat, nCols, nRows );
}
@@ -1059,7 +1058,7 @@ double ScInterpreter::Compare()
aComp.bEmpty[i] = true;
else if (pMat->IsString(0, 0))
{
- *aComp.pVal[i] = pMat->GetString(0, 0);
+ *aComp.pVal[i] = pMat->GetString(0, 0).getString();
aComp.bVal[i] = false;
}
else
@@ -1169,7 +1168,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScCompareOptions* pOptions )
if (aMat[i].mpMat->IsString(j, k))
{
aComp.bVal[i] = false;
- *aComp.pVal[i] = aMat[i].mpMat->GetString(j, k);
+ *aComp.pVal[i] = aMat[i].mpMat->GetString(j, k).getString();
aComp.bEmpty[i] = aMat[i].mpMat->IsEmpty(j, k);
}
else
@@ -1215,7 +1214,7 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScCompareOptions* pOptions )
else
{
aComp.bVal[i] = false;
- *aComp.pVal[i] = aMat[i].mpMat->GetString(j, k);
+ *aComp.pVal[i] = aMat[i].mpMat->GetString(j, k).getString();
aComp.bEmpty[i] = aMat[i].mpMat->IsEmpty(j, k);
}
aRes.mpMat->PutDouble(CompareFunc(aComp, pOptions), j, k);
@@ -4373,7 +4372,7 @@ public:
OUString GetString(SCSIZE i) const
{
- return mbColVec ? mrMat.GetString(0, i) : mrMat.GetString(i, 0);
+ return mbColVec ? mrMat.GetString(0, i).getString() : mrMat.GetString(i, 0).getString();
}
SCSIZE GetElementCount() const
@@ -6089,7 +6088,7 @@ void ScInterpreter::ScLookup()
if (pResMat->IsValue( 0, 0 ))
PushDouble(pResMat->GetDouble( 0, 0 ));
else
- PushString(pResMat->GetString( 0, 0 ));
+ PushString(pResMat->GetString(0, 0).getString());
}
else if (nParamCount == 3)
{
@@ -6152,7 +6151,7 @@ void ScInterpreter::ScLookup()
if (pDataMat->IsValue(0, i))
pTempMat->PutDouble(pDataMat->GetDouble(0, i), 0, i);
else
- pTempMat->PutString(mrStrPool.intern(pDataMat->GetString(0, i)), 0, i);
+ pTempMat->PutString(pDataMat->GetString(0, i), 0, i);
pDataMat2 = pTempMat;
}
else
@@ -6162,7 +6161,7 @@ void ScInterpreter::ScLookup()
if (pDataMat->IsValue(i, 0))
pTempMat->PutDouble(pDataMat->GetDouble(i, 0), i, 0);
else
- pTempMat->PutString(mrStrPool.intern(pDataMat->GetString(i, 0)), i, 0);
+ pTempMat->PutString(pDataMat->GetString(i, 0), i, 0);
pDataMat2 = pTempMat;
}
@@ -6294,14 +6293,14 @@ void ScInterpreter::ScLookup()
if (pDataMat->IsValue(nC-1, nDelta))
PushDouble(pDataMat->GetDouble(nC-1, nDelta));
else
- PushString(pDataMat->GetString(nC-1, nDelta));
+ PushString(pDataMat->GetString(nC-1, nDelta).getString());
}
else
{
if (pDataMat->IsValue(nDelta, nR-1))
PushDouble(pDataMat->GetDouble(nDelta, nR-1));
else
- PushString(pDataMat->GetString(nDelta, nR-1));
+ PushString(pDataMat->GetString(nDelta, nR-1).getString());
}
}
@@ -6563,7 +6562,7 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
//!!!!!!!
//! TODO: enable regex on matrix strings
//!!!!!!!
- OUString aParamStr = rItem.maString.getString();
+ svl::SharedString aParamStr = rItem.maString;
if ( bSorted )
{
static CollatorWrapper* pCollator = ScGlobal::GetCollator();
@@ -6572,7 +6571,8 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
if (bHLookup ? pMat->IsString(i, 0) : pMat->IsString(0, i))
{
sal_Int32 nRes =
- pCollator->compareString( bHLookup ? pMat->GetString(i,0) : pMat->GetString(0,i), aParamStr);
+ pCollator->compareString(
+ bHLookup ? pMat->GetString(i,0).getString() : pMat->GetString(0,i).getString(), aParamStr.getString());
if (nRes <= 0)
nDelta = i;
else if (i>0) // #i2168# ignore first mismatch
@@ -6590,8 +6590,7 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
{
if (pMat->IsString(i, 0))
{
- if ( ScGlobal::GetpTransliteration()->isEqual(
- pMat->GetString(i,0), aParamStr))
+ if (pMat->GetString(i,0).getDataIgnoreCase() == aParamStr.getDataIgnoreCase())
{
nDelta = i;
i = nMatCount + 1;
@@ -6653,7 +6652,7 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
nY = static_cast<SCSIZE>(nZIndex);
}
if ( pMat->IsString( nX, nY) )
- PushString(pMat->GetString( nX,nY));
+ PushString(pMat->GetString( nX,nY).getString());
else
PushDouble(pMat->GetDouble( nX,nY));
}
@@ -7616,7 +7615,7 @@ void ScInterpreter::ScIndex()
{
--nElement;
if (pMat->IsString( nElement))
- PushString( pMat->GetString( nElement));
+ PushString( pMat->GetString(nElement).getString());
else
PushDouble( pMat->GetDouble( nElement));
}
@@ -7631,8 +7630,8 @@ void ScInterpreter::ScIndex()
pResMat->PutDouble(pMat->GetDouble(i,
nRowMinus1), i, 0);
else
- pResMat->PutString(
- mrStrPool.intern(pMat->GetString(i, nRowMinus1)), i, 0);
+ pResMat->PutString(pMat->GetString(i, nRowMinus1), i, 0);
+
PushMatrix(pResMat);
}
else
@@ -7649,7 +7648,7 @@ void ScInterpreter::ScIndex()
pResMat->PutDouble(pMat->GetDouble(nColMinus1,
i), i);
else
- pResMat->PutString(mrStrPool.intern(pMat->GetString(nColMinus1, i)), i);
+ pResMat->PutString(pMat->GetString(nColMinus1, i), i);
PushMatrix(pResMat);
}
else
@@ -7665,7 +7664,7 @@ void ScInterpreter::ScIndex()
else
PushString( pMat->GetString(
static_cast<SCSIZE>(nCol-1),
- static_cast<SCSIZE>(nRow-1)));
+ static_cast<SCSIZE>(nRow-1)).getString());
}
}
}
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7aadff11b6a1..443590797682 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2353,7 +2353,7 @@ const OUString& ScInterpreter::GetStringFromMatrix(const ScMatrixRef& pMat)
; // nothing
else if ( !pJumpMatrix )
{
- aTempStr = pMat->GetString( *pFormatter, 0, 0);
+ aTempStr = pMat->GetString( *pFormatter, 0, 0).getString();
return aTempStr;
}
else
@@ -2363,7 +2363,7 @@ const OUString& ScInterpreter::GetStringFromMatrix(const ScMatrixRef& pMat)
pJumpMatrix->GetPos( nC, nR);
if ( nC < nCols && nR < nRows )
{
- aTempStr = pMat->GetString( *pFormatter, nC, nR);
+ aTempStr = pMat->GetString( *pFormatter, nC, nR).getString();
return aTempStr;
}
else
@@ -3277,7 +3277,7 @@ void ScInterpreter::ScMacro()
SbxVariable* p = refArray->Get32( nIdx );
if (pMat->IsString(nMatCol, nMatRow))
{
- p->PutString( pMat->GetString(nMatCol, nMatRow) );
+ p->PutString( pMat->GetString(nMatCol, nMatRow).getString() );
}
else
{
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index e9cd3b3f8045..ee34828157bc 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1084,8 +1084,8 @@ ScMatrixRef ScInterpreter::MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef
xResMat->PutError( nErr, i, j);
else
{
- OUString aTmp = pMat1->GetString(*pFormatter, i, j);
- aTmp += pMat2->GetString( *pFormatter, i, j);
+ OUString aTmp = pMat1->GetString(*pFormatter, i, j).getString();
+ aTmp += pMat2->GetString(*pFormatter, i, j).getString();
xResMat->PutString(mrStrPool.intern(aTmp), i, j);
}
}
@@ -1316,7 +1316,7 @@ void ScInterpreter::ScAmpersand()
else
{
OUString aTmp = sStr;
- aTmp += pMat->GetString( *pFormatter, i, j);
+ aTmp += pMat->GetString(*pFormatter, i, j).getString();
pResMat->PutString(mrStrPool.intern(aTmp), i, j);
}
}
@@ -1331,7 +1331,7 @@ void ScInterpreter::ScAmpersand()
pResMat->PutError( nErr, i, j);
else
{
- OUString aTmp = pMat->GetString(*pFormatter, i, j);
+ OUString aTmp = pMat->GetString(*pFormatter, i, j).getString();
aTmp += sStr;
pResMat->PutString(mrStrPool.intern(aTmp), i, j);
}
diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx
index d87f4003358e..fcdd17ea11e7 100644
--- a/sc/source/core/tool/rangeseq.cxx
+++ b/sc/source/core/tool/rangeseq.cxx
@@ -216,7 +216,7 @@ sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMa
if ( pMatrix->IsString( nCol, nRow ) )
{
if ( !pMatrix->IsEmpty( nCol, nRow ) )
- aStr = pMatrix->GetString( nCol, nRow );
+ aStr = pMatrix->GetString(nCol, nRow).getString();
}
else if ( pFormatter )
{
@@ -303,8 +303,8 @@ sal_Bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, const ScMatrix* pMat
{
OUString aStr;
if ( !pMatrix->IsEmpty( nCol, nRow ) )
- aStr = pMatrix->GetString( nCol, nRow );
- pColAry[nCol] <<= OUString( aStr );
+ aStr = pMatrix->GetString(nCol, nRow).getString();
+ pColAry[nCol] <<= aStr;
}
else
{
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index ad1712d400a7..af824acb573c 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -191,9 +191,9 @@ public:
sal_uInt16 GetError( SCSIZE nC, SCSIZE nR) const;
double GetDouble(SCSIZE nC, SCSIZE nR) const;
double GetDouble( SCSIZE nIndex) const;
- OUString GetString(SCSIZE nC, SCSIZE nR) const;
- OUString GetString( SCSIZE nIndex) const;
- OUString GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const;
+ svl::SharedString GetString(SCSIZE nC, SCSIZE nR) const;
+ svl::SharedString GetString( SCSIZE nIndex) const;
+ svl::SharedString GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const;
ScMatrixValue Get(SCSIZE nC, SCSIZE nR) const;
bool IsString( SCSIZE nIndex ) const;
bool IsString( SCSIZE nC, SCSIZE nR ) const;
@@ -222,7 +222,7 @@ public:
ScMatrix::IterateResult Product(bool bTextAsZero) const;
size_t Count(bool bCountStrings) const;
size_t MatchDoubleInColumns(double fValue, size_t nCol1, size_t nCol2) const;
- size_t MatchStringInColumns(const OUString& rStr, size_t nCol1, size_t nCol2) const;
+ size_t MatchStringInColumns(const svl::SharedString& rStr, size_t nCol1, size_t nCol2) const;
double GetMaxValue( bool bTextAsZero ) const;
double GetMinValue( bool bTextAsZero ) const;
@@ -471,7 +471,7 @@ double ScMatrixImpl::GetDouble( SCSIZE nIndex) const
return GetDouble(nC, nR);
}
-OUString ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const
+svl::SharedString ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const
{
if (ValidColRowOrReplicated( nC, nR ))
{
@@ -480,9 +480,9 @@ OUString ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const
switch (maMat.get_type(aPos))
{
case mdds::mtm::element_string:
- return maMat.get_string(aPos).getString();
+ return maMat.get_string(aPos);
case mdds::mtm::element_empty:
- return EMPTY_OUSTRING;
+ return svl::SharedString(EMPTY_OUSTRING);
case mdds::mtm::element_numeric:
case mdds::mtm::element_boolean:
OSL_FAIL("ScMatrixImpl::GetString: access error, no string");
@@ -496,17 +496,17 @@ OUString ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const
{
OSL_FAIL("ScMatrixImpl::GetString: dimension error");
}
- return EMPTY_OUSTRING;
+ return svl::SharedString(EMPTY_OUSTRING);
}
-OUString ScMatrixImpl::GetString( SCSIZE nIndex) const
+svl::SharedString ScMatrixImpl::GetString( SCSIZE nIndex) const
{
SCSIZE nC, nR;
CalcPosition(nIndex, nC, nR);
return GetString(nC, nR);
}
-OUString ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
+svl::SharedString ScMatrixImpl::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
{
if (!ValidColRowOrReplicated( nC, nR ))
{
@@ -1024,7 +1024,7 @@ size_t WalkAndMatchElements<double>::compare(const MatrixImplType::element_block
}
template<>
-size_t WalkAndMatchElements<OUString>::compare(const MatrixImplType::element_block_node_type& node) const
+size_t WalkAndMatchElements<svl::SharedString>::compare(const MatrixImplType::element_block_node_type& node) const
{
size_t nCount = 0;
switch (node.type)
@@ -1035,7 +1035,7 @@ size_t WalkAndMatchElements<OUString>::compare(const MatrixImplType::element_blo
MatrixImplType::string_block_type::const_iterator itEnd = MatrixImplType::string_block_type::end(*node.data);
for (; it != itEnd; ++it, ++nCount)
{
- if (ScGlobal::GetpTransliteration()->isEqual(it->getString(), maMatchValue))
+ if (it->getDataIgnoreCase() == maMatchValue.getDataIgnoreCase())
{
return mnIndex + nCount;
}
@@ -1292,9 +1292,9 @@ size_t ScMatrixImpl::MatchDoubleInColumns(double fValue, size_t nCol1, size_t nC
return aFunc.getMatching();
}
-size_t ScMatrixImpl::MatchStringInColumns(const OUString& rStr, size_t nCol1, size_t nCol2) const
+size_t ScMatrixImpl::MatchStringInColumns(const svl::SharedString& rStr, size_t nCol1, size_t nCol2) const
{
- WalkAndMatchElements<OUString> aFunc(rStr, maMat.size(), nCol1, nCol2);
+ WalkAndMatchElements<svl::SharedString> aFunc(rStr, maMat.size(), nCol1, nCol2);
maMat.walk(aFunc);
return aFunc.getMatching();
}
@@ -1548,17 +1548,17 @@ double ScMatrix::GetDouble( SCSIZE nIndex) const
return pImpl->GetDouble(nIndex);
}
-OUString ScMatrix::GetString(SCSIZE nC, SCSIZE nR) const
+svl::SharedString ScMatrix::GetString(SCSIZE nC, SCSIZE nR) const
{
return pImpl->GetString(nC, nR);
}
-OUString ScMatrix::GetString( SCSIZE nIndex) const
+svl::SharedString ScMatrix::GetString( SCSIZE nIndex) const
{
return pImpl->GetString(nIndex);
}
-OUString ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
+svl::SharedString ScMatrix::GetString( SvNumberFormatter& rFormatter, SCSIZE nC, SCSIZE nR) const
{
return pImpl->GetString(rFormatter, nC, nR);
}
@@ -1697,7 +1697,7 @@ size_t ScMatrix::MatchDoubleInColumns(double fValue, size_t nCol1, size_t nCol2)
return pImpl->MatchDoubleInColumns(fValue, nCol1, nCol2);
}
-size_t ScMatrix::MatchStringInColumns(const OUString& rStr, size_t nCol1, size_t nCol2) const {
+size_t ScMatrix::MatchStringInColumns(const svl::SharedString& rStr, size_t nCol1, size_t nCol2) const {
return pImpl->MatchStringInColumns(rStr, nCol1, nCol2);
}
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 85450d4024b3..59d877e368eb 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -40,6 +40,7 @@
#include "scmatrix.hxx"
#include "formula/opcode.hxx"
+#include "svl/sharedstring.hxx"
#include <sfx2/objsh.hxx>
#include <vcl/svapp.hxx>
@@ -2726,7 +2727,7 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke
++nDataCount;
rItem.mbIsValue = false;
- rItem.maString = pMat->GetString(nC, nR);
+ rItem.maString = pMat->GetString(nC, nR).getString();
}
}
}