[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 1 18:33:21 UTC 2018


 sc/source/core/tool/cellform.cxx |   22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 00dca13f5a6b0a033c823b2679f81a7034f38fd5
Author:     Serge Krot <Serge.Krot at cib.de>
AuthorDate: Fri Oct 5 21:21:58 2018 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Nov 1 19:32:55 2018 +0100

    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 at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/62747
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index a9877cec9c0a..d8f383585b88 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -51,7 +51,7 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uLong nFormat, OUString
         break;
         case CELLTYPE_VALUE:
         {
-            double nValue = rCell.mfValue;
+            const double & nValue = rCell.mfValue;
             if (!bNullVals && nValue == 0.0)
                 rString.clear();
             else
@@ -95,7 +95,7 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uLong nFormat, OUString
                 }
                 else
                 {
-                    sal_uInt16 nErrCode = pFCell->GetErrCode();
+                    const sal_uInt16 nErrCode = pFCell->GetErrCode();
 
                     if (nErrCode != 0)
                         rString = ScGlobal::GetErrorString(nErrCode);
@@ -141,36 +141,34 @@ OUString ScCellFormat::GetString(
 void ScCellFormat::GetInputString(
     ScRefCellValue& rCell, sal_uLong 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();
 
-            sal_uInt16 nErrCode = pFC->GetErrCode();
+            const sal_uInt16 nErrCode = pFC->GetErrCode();
             if (nErrCode != 0)
-                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 )


More information about the Libreoffice-commits mailing list