summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-06-16 17:57:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-17 15:59:42 +0200
commit12b817140641a94ebb3ef8271c5e955eb80e56f2 (patch)
treeed920ec3c4efe6051ca65b340ed14bf0a51a8c22 /sc/source/core
parentc1eba8d34a5ea13e6317c7820507d717ace4ec5c (diff)
create getter for ScCellValue::mpString
so we can assert that it has the correct tag type Change-Id: I8933919aefc2bb22694a283b54dc3de11d16e5a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/column3.cxx2
-rw-r--r--sc/source/core/data/column4.cxx4
-rw-r--r--sc/source/core/data/conditio.cxx2
-rw-r--r--sc/source/core/data/dociter.cxx2
-rw-r--r--sc/source/core/data/documen8.cxx4
-rw-r--r--sc/source/core/data/documentimport.cxx4
-rw-r--r--sc/source/core/data/table3.cxx6
-rw-r--r--sc/source/core/data/table4.cxx4
-rw-r--r--sc/source/core/data/validat.cxx2
-rw-r--r--sc/source/core/tool/cellform.cxx2
-rw-r--r--sc/source/core/tool/chgtrack.cxx4
11 files changed, 18 insertions, 18 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index e8a14b75b498..7586b000768d 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2885,7 +2885,7 @@ public:
rColumn.SetValue(aBlockPos, r.mnRow, r.maValue.getDouble(), false);
break;
case CELLTYPE_STRING:
- rColumn.SetRawString(aBlockPos, r.mnRow, *r.maValue.mpString, false);
+ rColumn.SetRawString(aBlockPos, r.mnRow, *r.maValue.getSharedString(), false);
break;
default:
;
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 7861ed5ce55e..6c710d9ed22e 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -291,8 +291,8 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1,
// same document. If not, re-intern shared strings.
svl::SharedStringPool* pSharedStringPool = (bSameDocPool ? nullptr : &rDocument.GetSharedStringPool());
svl::SharedString aStr = (pSharedStringPool ?
- pSharedStringPool->intern( rSrcCell.mpString->getString()) :
- *rSrcCell.mpString);
+ pSharedStringPool->intern( rSrcCell.getSharedString()-> getString()) :
+ *rSrcCell.getSharedString());
std::vector<svl::SharedString> aStrs(nDestSize, aStr);
pBlockPos->miCellPos =
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 6c4213888017..90ea65ba1b0c 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -746,7 +746,7 @@ static bool lcl_GetCellContent( ScRefCellValue& rCell, bool bIsStr1, double& rAr
case CELLTYPE_EDIT:
bVal = false;
if (rCell.getType() == CELLTYPE_STRING)
- rArgStr = rCell.mpString->getString();
+ rArgStr = rCell.getSharedString()->getString();
else if (rCell.mpEditText)
rArgStr = ScEditUtil::GetString(*rCell.mpEditText, pDoc);
break;
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 3efaa48d7b5a..3eb95c8eaeb9 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -975,7 +975,7 @@ ScCellValue ScCellIterator::getCellValue() const
switch (maCurCell.getType())
{
case CELLTYPE_STRING:
- return ScCellValue(new svl::SharedString(*maCurCell.mpString));
+ return ScCellValue(maCurCell.getSharedString());
break;
case CELLTYPE_EDIT:
return ScCellValue(maCurCell.mpEditText->Clone());
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index c09bd16d3dc8..2da4ddfa53fb 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1262,7 +1262,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, Transliteratio
}
pEngine->SetDefaults( std::move(aDefaults) );
if (aCell.getType() == CELLTYPE_STRING)
- pEngine->SetTextCurrentDefaults(aCell.mpString->getString());
+ pEngine->SetTextCurrentDefaults(aCell.getSharedString()->getString());
else if (aCell.mpEditText)
pEngine->SetTextCurrentDefaults(*aCell.mpEditText);
@@ -1298,7 +1298,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, Transliteratio
else if (aCell.getType() == CELLTYPE_STRING)
{
- OUString aOldStr = aCell.mpString->getString();
+ OUString aOldStr = aCell.getSharedString()->getString();
sal_Int32 nOldLen = aOldStr.getLength();
if ( bConsiderLanguage )
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 867a16a6f1ec..b091b99ff152 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -224,7 +224,7 @@ void ScDocumentImport::setAutoInput(const ScAddress& rPos, const OUString& rStr,
{
case CELLTYPE_STRING:
// string is copied.
- pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, rPos.Row(), *aCell.mpString);
+ pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, rPos.Row(), *aCell.getSharedString());
break;
case CELLTYPE_EDIT:
// Cell takes the ownership of the text object.
@@ -583,7 +583,7 @@ void ScDocumentImport::fillDownCells(const ScAddress& rPos, SCROW nFillSize)
}
case CELLTYPE_STRING:
{
- std::vector<svl::SharedString> aCopied(nFillSize, *aRefCell.mpString);
+ std::vector<svl::SharedString> aCopied(nFillSize, *aRefCell.getSharedString());
pBlockPos->miCellPos = rCells.set(
pBlockPos->miCellPos, rPos.Row()+1, aCopied.begin(), aCopied.end());
break;
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 19db5e6c08dc..f1027716f03e 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -728,7 +728,7 @@ void fillSortedColumnArray(
{
case CELLTYPE_STRING:
assert(rCell.mpAttr);
- rCellStore.push_back(*rCell.maCell.mpString);
+ rCellStore.push_back(*rCell.maCell.getSharedString());
break;
case CELLTYPE_VALUE:
assert(rCell.mpAttr);
@@ -1570,11 +1570,11 @@ short ScTable::CompareCell(
OUString aStr1;
OUString aStr2;
if (eType1 == CELLTYPE_STRING)
- aStr1 = rCell1.mpString->getString();
+ aStr1 = rCell1.getSharedString()->getString();
else
aStr1 = GetString(nCell1Col, nCell1Row);
if (eType2 == CELLTYPE_STRING)
- aStr2 = rCell2.mpString->getString();
+ aStr2 = rCell2.getSharedString()->getString();
else
aStr2 = GetString(nCell2Col, nCell2Row);
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 80d656d4dd59..8877e90d20e0 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1916,7 +1916,7 @@ void ScTable::FillAutoSimple(
case CELLTYPE_STRING:
case CELLTYPE_EDIT:
if (aSrcCell.getType() == CELLTYPE_STRING)
- aValue = aSrcCell.mpString->getString();
+ aValue = aSrcCell.getSharedString()->getString();
else
aValue = ScEditUtil::GetString(*aSrcCell.mpEditText, &rDocument);
if ( !(nScFillModeMouseModifier & KEY_MOD1) && !bHasFiltered )
@@ -2460,7 +2460,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
}
OUString aValue;
if (eCellType == CELLTYPE_STRING)
- aValue = aSrcCell.mpString->getString();
+ aValue = aSrcCell.getSharedString()->getString();
else
aValue = ScEditUtil::GetString(*aSrcCell.mpEditText, &rDocument);
sal_Int32 nStringValue;
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index abe48eecb3a9..4c8617a47c9e 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -579,7 +579,7 @@ bool ScValidationData::IsDataValid( ScRefCellValue& rCell, const ScAddress& rPos
nVal = rCell.getDouble();
break;
case CELLTYPE_STRING:
- aString = rCell.mpString->getString();
+ aString = rCell.getSharedString()->getString();
bIsVal = false;
break;
case CELLTYPE_EDIT:
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 742e896e03b1..7e75ced777ab 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -39,7 +39,7 @@ OUString ScCellFormat::GetString( const ScRefCellValue& rCell, sal_uInt32 nForma
case CELLTYPE_STRING:
{
OUString str;
- rFormatter.GetOutputString(rCell.mpString->getString(), nFormat, str, ppColor, bUseStarFormat);
+ rFormatter.GetOutputString(rCell.getSharedString()->getString(), nFormat, str, ppColor, bUseStarFormat);
return str;
}
case CELLTYPE_EDIT:
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index cf6cd43ffd0c..d89f38dbb06d 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1564,7 +1564,7 @@ OUString ScChangeActionContent::GetStringOfCell(
return str;
}
case CELLTYPE_STRING:
- return rCell.mpString->getString();
+ return rCell.getSharedString()->getString();
case CELLTYPE_EDIT:
if (rCell.mpEditText)
return ScEditUtil::GetString(*rCell.mpEditText, pDoc);
@@ -1705,7 +1705,7 @@ OUString ScChangeActionContent::GetValueString(
switch (rCell.getType())
{
case CELLTYPE_STRING :
- return rCell.mpString->getString();
+ return rCell.getSharedString()->getString();
case CELLTYPE_EDIT :
if (rCell.mpEditText)
return ScEditUtil::GetString(*rCell.mpEditText, pDoc);