summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2018-10-05 21:21:58 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-10-08 10:42:45 +0200
commit2060909e8e9f1b3483b32fc15b5c70372825b1c3 (patch)
treefd4f4280e3bc8cd86fa5866707bd7fd5c3649bee /sc
parent5181253946ca1877cc42050452aa6d733d6da3f1 (diff)
sc: speed-up: no usage of temp strings objects
Change-Id: I7d9812672e4cbefd7e422b5c70b54ee3ea50df2d Reviewed-on: https://gerrit.libreoffice.org/61446 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/cellform.cxx22
1 files changed, 10 insertions, 12 deletions
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index ce40a1daefe4..858097ed8357 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -46,7 +46,7 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uInt32 nFormat, OUStrin
break;
case CELLTYPE_VALUE:
{
- double nValue = rCell.mfValue;
+ const double & nValue = rCell.mfValue;
if (!bNullVals && nValue == 0.0)
rString.clear();
else
@@ -76,7 +76,7 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uInt32 nFormat, OUStrin
}
else
{
- FormulaError nErrCode = pFCell->GetErrCode();
+ const FormulaError nErrCode = pFCell->GetErrCode();
if (nErrCode != FormulaError::NONE)
rString = ScGlobal::GetErrorString(nErrCode);
@@ -120,36 +120,34 @@ OUString ScCellFormat::GetString(
void ScCellFormat::GetInputString(
ScRefCellValue& rCell, sal_uInt32 nFormat, OUString& rString, SvNumberFormatter& rFormatter, const ScDocument* pDoc )
{
- OUString aString = rString;
switch (rCell.meType)
{
case CELLTYPE_STRING:
case CELLTYPE_EDIT:
- aString = rCell.getString(pDoc);
+ rString = rCell.getString(pDoc);
break;
case CELLTYPE_VALUE:
- rFormatter.GetInputLineString(rCell.mfValue, nFormat, aString );
+ rFormatter.GetInputLineString(rCell.mfValue, nFormat, rString );
break;
case CELLTYPE_FORMULA:
{
ScFormulaCell* pFC = rCell.mpFormula;
if (pFC->IsEmptyDisplayedAsString())
- aString = EMPTY_OUSTRING;
+ rString = EMPTY_OUSTRING;
else if (pFC->IsValue())
- rFormatter.GetInputLineString(pFC->GetValue(), nFormat, aString);
+ rFormatter.GetInputLineString(pFC->GetValue(), nFormat, rString);
else
- aString = pFC->GetString().getString();
+ rString = pFC->GetString().getString();
- FormulaError nErrCode = pFC->GetErrCode();
+ const FormulaError nErrCode = pFC->GetErrCode();
if (nErrCode != FormulaError::NONE)
- aString = EMPTY_OUSTRING;
+ rString = EMPTY_OUSTRING;
}
break;
default:
- aString = EMPTY_OUSTRING;
+ rString = EMPTY_OUSTRING;
break;
}
- rString = aString;
}
OUString ScCellFormat::GetOutputString( ScDocument& rDoc, const ScAddress& rPos, ScRefCellValue& rCell )