include/svl/nfengine.hxx                               |   10 +++----
 include/svl/numformat.hxx                              |    4 +-
 sc/inc/interpretercontext.hxx                          |    4 +-
 sc/source/core/data/column3.cxx                        |    4 +-
 sc/source/core/data/conditio.cxx                       |    4 +-
 sc/source/core/data/document.cxx                       |    4 +-
 sc/source/core/data/dputil.cxx                         |    8 +----
 sc/source/core/data/validat.cxx                        |    5 +--
 sc/source/core/tool/cellform.cxx                       |   23 ++---------------
 sc/source/core/tool/chgtrack.cxx                       |   12 ++------
 sc/source/core/tool/interpr4.cxx                       |    4 --
 sc/source/core/tool/interpretercontext.cxx             |   10 ++-----
 sc/source/core/tool/scmatrix.cxx                       |   16 +++--------
 sc/source/filter/rtf/eeimpars.cxx                      |    2 -
 sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |    2 -
 sc/source/ui/app/inputhdl.cxx                          |    2 -
 sc/source/ui/condformat/colorformat.cxx                |    4 --
 sc/source/ui/condformat/condformatdlgentry.cxx         |    7 +----
 sc/source/ui/dbgui/filtdlg.cxx                         |    8 ++---
 sc/source/ui/miscdlgs/filldlg.cxx                      |    5 +--
 sc/source/ui/unoobj/cellsuno.cxx                       |    3 --
 sc/source/ui/unoobj/datauno.cxx                        |    9 ++----
 sfx2/source/dialog/dinfdlg.cxx                         |   11 ++------
 svl/source/numbers/numfmuno.cxx                        |    5 ---
 svl/source/numbers/zforlist.cxx                        |   12 ++++----
 svtools/source/svhtml/htmlout.cxx                      |    3 --
 sw/source/core/fields/fldbas.cxx                       |    6 ----
 vcl/source/control/fmtfield.cxx                        |    4 +-
 28 files changed, 67 insertions(+), 124 deletions(-)

New commits:
commit 621caf93ce15a49a5f08599e45b047de08ee223d
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Oct 24 09:24:06 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Fri Oct 25 08:21:10 2024 +0200

    speedup saving large XLS file with lots of query formula(2)
    
    reduce cost of OUString construction by avoiding
    initialising a temporary and then overwriting it.
    
    12s to 10s
    
    Change-Id: I889152ba71947004ca7d5c96f073182c94d95ed5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175539
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/include/svl/nfengine.hxx b/include/svl/nfengine.hxx
index f8ec16f28fbb..a057ebef3bee 100644
--- a/include/svl/nfengine.hxx
+++ b/include/svl/nfengine.hxx
@@ -349,11 +349,11 @@ public:
     static sal_uInt16 GetFormatPrecision(SvNFLanguageData& rCurrentLanguage,
                                          const SvNFFormatData& rFormatData, 
sal_uInt32 nFormat);
 
-    static void GetInputLineString(SvNFLanguageData& rCurrentLanguage,
-                                   const SvNFFormatData& rFormatData,
-                                   const NativeNumberWrapper& rNatNum, const 
Accessor& rFuncs,
-                                   const double& fOutNumber, sal_uInt32 
nFIndex,
-                                   OUString& sOutString, bool bFiltering, bool 
bForceSystemLocale);
+    static OUString GetInputLineString(SvNFLanguageData& rCurrentLanguage,
+                                       const SvNFFormatData& rFormatData,
+                                       const NativeNumberWrapper& rNatNum, 
const Accessor& rFuncs,
+                                       const double& fOutNumber, sal_uInt32 
nFIndex,
+                                       bool bFiltering, bool 
bForceSystemLocale);
 
     static sal_uInt32 GetEditFormat(SvNFLanguageData& rCurrentLanguage,
                                     const SvNFFormatData& rFormatData,
diff --git a/include/svl/numformat.hxx b/include/svl/numformat.hxx
index 92746e033e61..e82be6e27d22 100644
--- a/include/svl/numformat.hxx
+++ b/include/svl/numformat.hxx
@@ -188,8 +188,8 @@ public:
         a number rounded by the cell format, which rounded value is used
         in the filtering condition now), instead of the EditFormat string
         (e.g a not rounded value, which is visible during editing).*/
-    void GetInputLineString(const double& fOutNumber, sal_uInt32 nFIndex, 
OUString& rOutString,
-                            bool bFiltering = false, bool bForceSystemLocale = 
false);
+    OUString GetInputLineString(const double& fOutNumber, sal_uInt32 nFIndex,
+                                bool bFiltering = false, bool 
bForceSystemLocale = false);
 
     /** Format a number according to a format code string to be scanned.
         @return
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx
index cd72d19eb9b6..4f66f29e31b6 100644
--- a/sc/inc/interpretercontext.hxx
+++ b/sc/inc/interpretercontext.hxx
@@ -79,8 +79,8 @@ struct ScInterpreterContext
     bool NFIsNumberFormat(const OUString& sString, sal_uInt32& F_Index, 
double& fOutNumber,
                           SvNumInputOptions eInputOptions = 
SvNumInputOptions::NONE);
 
-    void NFGetInputLineString(const double& fOutNumber, sal_uInt32 nFIndex, 
OUString& rOutString,
-                              bool bFiltering = false, bool bForceSystemLocale 
= false) const;
+    OUString NFGetInputLineString(const double& fOutNumber, sal_uInt32 nFIndex,
+                                  bool bFiltering = false, bool 
bForceSystemLocale = false) const;
 
     void NFGetOutputString(const double& fOutNumber, sal_uInt32 nFIndex, 
OUString& sOutString,
                            const Color** ppColor, bool bUseStarFormat = false) 
const;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 9326fbab4d1f..ab8b434a1e9d 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2654,7 +2654,7 @@ class FilterEntriesHandler
             // Convert string representation to ISO 8601 date to eliminate
             // locale dependent behaviour later when filtering for dates.
             sal_uInt32 nIndex = rContext.NFGetFormatIndex( 
NF_DATE_DIN_YYYYMMDD);
-            rContext.NFGetInputLineString( fVal, nIndex, aStr);
+            aStr = rContext.NFGetInputLineString( fVal, nIndex);
         }
         else if (nType == SvNumFormatType::DATETIME)
         {
@@ -2662,7 +2662,7 @@ class FilterEntriesHandler
             // Convert string representation to ISO 8601 (with blank instead 
of T) datetime
             // to eliminate locale dependent behaviour later when filtering 
for datetimes.
             sal_uInt32 nIndex = 
rContext.NFGetFormatIndex(NF_DATETIME_ISO_YYYYMMDD_HHMMSS);
-            rContext.NFGetInputLineString(fVal, nIndex, aStr);
+            aStr = rContext.NFGetInputLineString(fVal, nIndex);
         }
         // store the formatted/rounded value for filtering
         if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate)
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 3c54b590d4e0..29c1c2654f83 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1317,7 +1317,7 @@ OUString ScConditionEntry::GetExpression( const 
ScAddress& rCursor, sal_uInt16 n
             aRet = "\"" + aStrVal1 + "\"";
         }
         else
-            mpDoc->GetFormatTable()->GetInputLineString(nVal1, nNumFmt, aRet);
+            aRet = mpDoc->GetFormatTable()->GetInputLineString(nVal1, nNumFmt);
     }
     else if ( nIndex==1 )
     {
@@ -1333,7 +1333,7 @@ OUString ScConditionEntry::GetExpression( const 
ScAddress& rCursor, sal_uInt16 n
             aRet = "\"" + aStrVal2 + "\"";
         }
         else
-            mpDoc->GetFormatTable()->GetInputLineString(nVal2, nNumFmt, aRet);
+            aRet = mpDoc->GetFormatTable()->GetInputLineString(nVal2, nNumFmt);
     }
 
     return aRet;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index f1ff4241413d..f97fca6ef8a9 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3620,7 +3620,7 @@ FormulaError ScDocument::GetStringForFormula( const 
ScAddress& rPos, OUString& r
                 sal_uInt32 nIndex = pFormatter->GetStandardFormat(
                                     SvNumFormatType::NUMBER,
                                     ScGlobal::eLnge);
-                pFormatter->GetInputLineString(fVal, nIndex, aStr);
+                aStr = pFormatter->GetInputLineString(fVal, nIndex);
             }
             else
                 aStr = pFCell->GetString().getString();
@@ -3632,7 +3632,7 @@ FormulaError ScDocument::GetStringForFormula( const 
ScAddress& rPos, OUString& r
             sal_uInt32 nIndex = pFormatter->GetStandardFormat(
                                     SvNumFormatType::NUMBER,
                                     ScGlobal::eLnge);
-            pFormatter->GetInputLineString(fVal, nIndex, aStr);
+            aStr = pFormatter->GetInputLineString(fVal, nIndex);
         }
         break;
         default:
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index 63d320fe123d..30abc1760385 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -43,9 +43,7 @@ OUString getTwoDigitString(sal_Int32 nValue)
 void appendDateStr(OUStringBuffer& rBuffer, double fValue, SvNumberFormatter* 
pFormatter)
 {
     sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, 
ScGlobal::eLnge );
-    OUString aString;
-    pFormatter->GetInputLineString(fValue, nFormat, aString);
-    rBuffer.append(aString);
+    rBuffer.append(pFormatter->GetInputLineString(fValue, nFormat));
 }
 
 OUString getSpecialDateName(double fValue, bool bFirst, SvNumberFormatter* 
pFormatter)
@@ -190,9 +188,7 @@ namespace {
 void lcl_AppendDateStr( OUStringBuffer& rBuffer, double fValue, 
SvNumberFormatter* pFormatter )
 {
     sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::DATE, 
ScGlobal::eLnge );
-    OUString aString;
-    pFormatter->GetInputLineString( fValue, nFormat, aString );
-    rBuffer.append( aString );
+    rBuffer.append( pFormatter->GetInputLineString( fValue, nFormat ) );
 }
 
 OUString lcl_GetSpecialNumGroupName( double fValue, bool bFirst, sal_Unicode 
cDecSeparator,
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 6a4a4aed064e..a830da8cef34 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -526,8 +526,7 @@ bool ScValidationData::IsDataValidTextLen( 
std::u16string_view rTest, const ScAd
         // determine length, otherwise an once accepted value maybe could
         // not be edited again, for example abbreviated dates or leading
         // zeros or trailing zeros after decimal separator change length.
-        OUString aStr;
-        pDataNumeric->mpFormatter->GetInputLineString( pDataNumeric->mfVal, 
pDataNumeric->mnFormat, aStr);
+        OUString aStr = pDataNumeric->mpFormatter->GetInputLineString( 
pDataNumeric->mfVal, pDataNumeric->mnFormat);
         nLen = aStr.getLength();
     }
     ScRefCellValue aTmpCell( static_cast<double>(nLen));
@@ -960,7 +959,7 @@ bool ScValidationData::GetSelectionFromFormula(
                     }
                     else
                     {
-                        pFormatter->GetInputLineString( nMatVal.fVal, 
nDestFormat, aValStr );
+                        aValStr = pFormatter->GetInputLineString( 
nMatVal.fVal, nDestFormat );
                     }
                 }
 
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 692b019586c2..2447e357d32c 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -141,11 +141,7 @@ OUString ScCellFormat::GetInputString(
         case CELLTYPE_EDIT:
             return rCell.getString(&rDoc);
         case CELLTYPE_VALUE:
-        {
-            OUString str;
-            rContext.NFGetInputLineString(rCell.getDouble(), nFormat, str, 
bFiltering, bForceSystemLocale);
-            return str;
-        }
+            return rContext.NFGetInputLineString(rCell.getDouble(), nFormat, 
bFiltering, bForceSystemLocale);
         break;
         case CELLTYPE_FORMULA:
         {
@@ -154,10 +150,7 @@ OUString ScCellFormat::GetInputString(
             if (pFC->IsEmptyDisplayedAsString())
                 ; // empty
             else if (pFC->IsValue())
-            {
-                str.emplace();
-                rContext.NFGetInputLineString(pFC->GetValue(), nFormat, *str, 
bFiltering, bForceSystemLocale);
-            }
+                str = rContext.NFGetInputLineString(pFC->GetValue(), nFormat, 
bFiltering, bForceSystemLocale);
             else
                 str = pFC->GetString().getString();
 
@@ -187,11 +180,7 @@ svl::SharedString ScCellFormat::GetInputSharedString(
         case CELLTYPE_EDIT:
             return rCell.getSharedString(&rDoc, rStrPool);
         case CELLTYPE_VALUE:
-        {
-            OUString str;
-            rContext.NFGetInputLineString(rCell.getDouble(), nFormat, str, 
bFiltering, bForceSystemLocale);
-            return rStrPool.intern(str);
-        }
+            return 
rStrPool.intern(rContext.NFGetInputLineString(rCell.getDouble(), nFormat, 
bFiltering, bForceSystemLocale));
         break;
         case CELLTYPE_FORMULA:
         {
@@ -202,11 +191,7 @@ svl::SharedString ScCellFormat::GetInputSharedString(
             else if (pFC->IsEmptyDisplayedAsString())
                 return svl::SharedString::getEmptyString();
             else if (pFC->IsValue())
-            {
-                OUString str;
-                rContext.NFGetInputLineString(pFC->GetValue(), nFormat, str, 
bFiltering, bForceSystemLocale);
-                return rStrPool.intern(str);
-            }
+                return 
rStrPool.intern(rContext.NFGetInputLineString(pFC->GetValue(), nFormat, 
bFiltering, bForceSystemLocale));
             else
                 return pFC->GetString();
         }
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 657601a224de..034899d082e6 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -1557,11 +1557,7 @@ OUString ScChangeActionContent::GetStringOfCell(
     switch (rCell.getType())
     {
         case CELLTYPE_VALUE:
-        {
-            OUString str;
-            pDoc->GetFormatTable()->GetInputLineString(rCell.getDouble(), 
nFormat, str);
-            return str;
-        }
+            return 
pDoc->GetFormatTable()->GetInputLineString(rCell.getDouble(), nFormat);
         case CELLTYPE_STRING:
             return rCell.getSharedString()->getString();
         case CELLTYPE_EDIT:
@@ -1654,8 +1650,8 @@ void ScChangeActionContent::SetValue(
         {
             case CELLTYPE_VALUE :
             {   // E.g.: Remember date as such
-                pFromDoc->GetFormatTable()->GetInputLineString(
-                    rOrgCell.getDouble(), nFormat, rStr);
+                rStr = pFromDoc->GetFormatTable()->GetInputLineString(
+                    rOrgCell.getDouble(), nFormat);
             }
             break;
             case CELLTYPE_FORMULA :
@@ -1681,7 +1677,7 @@ void ScChangeActionContent::SetCell( OUString& rStr, 
ScCellValue& rCell, sal_uLo
     {
         case CELLTYPE_VALUE :
             // e.g. remember date as date string
-            pDoc->GetFormatTable()->GetInputLineString(rCell.getDouble(), 
nFormat, rStr);
+            rStr = 
pDoc->GetFormatTable()->GetInputLineString(rCell.getDouble(), nFormat);
         break;
         case CELLTYPE_FORMULA :
             rCell.getFormula()->SetInChangeTrack(true);
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index d463ffdd81a6..fcc58c364ec4 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2534,9 +2534,7 @@ svl::SharedString ScInterpreter::GetStringFromDouble( 
double fVal )
     sal_uLong nIndex = mrContext.NFGetStandardFormat(
                         SvNumFormatType::NUMBER,
                         ScGlobal::eLnge);
-    OUString aStr;
-    mrContext.NFGetInputLineString(fVal, nIndex, aStr);
-    return mrStrPool.intern(aStr);
+    return mrStrPool.intern(mrContext.NFGetInputLineString(fVal, nIndex));
 }
 
 void ScInterpreter::ScDBGet()
diff --git a/sc/source/core/tool/interpretercontext.cxx 
b/sc/source/core/tool/interpretercontext.cxx
index 26aaeaf3e8e6..a8627a327469 100644
--- a/sc/source/core/tool/interpretercontext.cxx
+++ b/sc/source/core/tool/interpretercontext.cxx
@@ -238,16 +238,14 @@ sal_uInt32 
ScInterpreterContext::NFGetStandardFormat(sal_uInt32 nFIndex, SvNumFo
                                          nFIndex, eType, eLnge);
 }
 
-void ScInterpreterContext::NFGetInputLineString(const double& fOutNumber, 
sal_uInt32 nFIndex,
-                                                OUString& rOutString, bool 
bFiltering,
-                                                bool bForceSystemLocale) const
+OUString ScInterpreterContext::NFGetInputLineString(const double& fOutNumber, 
sal_uInt32 nFIndex,
+                                                    bool bFiltering, bool 
bForceSystemLocale) const
 {
     if (!mpDoc->IsThreadedGroupCalcInProgress())
-        return GetFormatTable()->GetInputLineString(fOutNumber, nFIndex, 
rOutString, bFiltering,
+        return GetFormatTable()->GetInputLineString(fOutNumber, nFIndex, 
bFiltering,
                                                     bForceSystemLocale);
     return SvNFEngine::GetInputLineString(*mxLanguageData, *mpFormatData, 
*mpNatNum, maROPolicy,
-                                          fOutNumber, nFIndex, rOutString, 
bFiltering,
-                                          bForceSystemLocale);
+                                          fOutNumber, nFIndex, bFiltering, 
bForceSystemLocale);
 }
 void ScInterpreterContext::NFGetOutputString(const double& fOutNumber, 
sal_uInt32 nFIndex,
                                              OUString& sOutString, const 
Color** ppColor,
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index fcc3b290d3d1..0f792203c66b 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -779,9 +779,7 @@ svl::SharedString ScMatrixImpl::GetString( 
ScInterpreterContext& rContext, SCSIZ
 
     sal_uInt32 nKey = rContext.NFGetStandardFormat( SvNumFormatType::NUMBER,
             ScGlobal::eLnge);
-    OUString aStr;
-    rContext.NFGetInputLineString( fVal, nKey, aStr);
-    return svl::SharedString( aStr);    // string not interned
+    return svl::SharedString(rContext.NFGetInputLineString( fVal, nKey )); // 
string not interned
 }
 
 ScMatrixValue ScMatrixImpl::Get(SCSIZE nC, SCSIZE nR) const
@@ -2718,16 +2716,14 @@ void ScMatrixImpl::MatConcat(SCSIZE nMaxCol, SCSIZE 
nMaxRow, const ScMatrixRef&
                 nErrors[get_index(nMaxRow, nRow, nCol, nRowOffset, 
nColOffset)] = nErr;
                 return;
             }
-            OUString aStr;
-            rContext.NFGetInputLineString( nVal, nKey, aStr);
+            OUString aStr = rContext.NFGetInputLineString( nVal, nKey );
             aString[get_index(nMaxRow, nRow, nCol, nRowOffset, nColOffset)] = 
aString[get_index(nMaxRow, nRow, nCol, nRowOffset, nColOffset)] + aStr;
         };
 
     std::function<void(size_t, size_t, bool)> aBoolFunc =
         [&](size_t nRow, size_t nCol, bool nVal)
         {
-            OUString aStr;
-            rContext.NFGetInputLineString( nVal ? 1.0 : 0.0, nKey, aStr);
+            OUString aStr = rContext.NFGetInputLineString( nVal ? 1.0 : 0.0, 
nKey);
             aString[get_index(nMaxRow, nRow, nCol, nRowOffset, nColOffset)] = 
aString[get_index(nMaxRow, nRow, nCol, nRowOffset, nColOffset)] + aStr;
         };
 
@@ -2780,16 +2776,14 @@ void ScMatrixImpl::MatConcat(SCSIZE nMaxCol, SCSIZE 
nMaxRow, const ScMatrixRef&
                 nErrors[get_index(nMaxRow, nRow, nCol, nRowOffset, 
nColOffset)] = nErr;
                 return;
             }
-            OUString aStr;
-            rContext.NFGetInputLineString( nVal, nKey, aStr);
+            OUString aStr = rContext.NFGetInputLineString( nVal, nKey );
             aSharedString[get_index(nMaxRow, nRow, nCol, nRowOffset, 
nColOffset)] = rStringPool.intern(aString[get_index(nMaxRow, nRow, nCol, 
nRowOffset, nColOffset)] + aStr);
         };
 
     std::function<void(size_t, size_t, bool)> aBoolFunc2 =
         [&](size_t nRow, size_t nCol, bool nVal)
         {
-            OUString aStr;
-            rContext.NFGetInputLineString( nVal ? 1.0 : 0.0, nKey, aStr);
+            OUString aStr = rContext.NFGetInputLineString( nVal ? 1.0 : 0.0, 
nKey);
             aSharedString[get_index(nMaxRow, nRow, nCol, nRowOffset, 
nColOffset)] = rStringPool.intern(aString[get_index(nMaxRow, nRow, nCol, 
nRowOffset, nColOffset)] + aStr);
         };
 
diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index e6f1072f3fbe..577f43efddca 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -388,7 +388,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, 
double nOutputFactor, SvNu
                                 pFormatter->GetFormatForLanguageIfBuiltIn(
                                         nIndex, LANGUAGE_SYSTEM);
                             OSL_ENSURE( nNewIndex != nIndex, 
"ScEEImport::WriteToDocument: NumbersEnglishUS not a built-in format?");
-                            pFormatter->GetInputLineString( fEnVal, nNewIndex, 
aStr);
+                            aStr = pFormatter->GetInputLineString( fEnVal, 
nNewIndex );
                         }
                         else
                             bTextFormat = true;
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx 
b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index ae5627385fa9..1bc9c21b0e6f 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -71,7 +71,7 @@ const ScCellValue& ScMyCellInfo::CreateCell(ScDocument& rDoc)
             nFormat = rDoc.GetFormatTable()->GetStandardFormat( 
SvNumFormatType::DATE, ScGlobal::eLnge );
         else if (nType == css::util::NumberFormat::TIME)
             nFormat = rDoc.GetFormatTable()->GetStandardFormat( 
SvNumFormatType::TIME, ScGlobal::eLnge );
-        rDoc.GetFormatTable()->GetInputLineString(fValue, nFormat, 
sInputString);
+        sInputString = rDoc.GetFormatTable()->GetInputLineString(fValue, 
nFormat);
     }
 
     return maCell;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index d6b7544d33cb..deb6166bfbd5 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1914,7 +1914,7 @@ static OUString lcl_Calculate( const OUString& rFormula, 
ScDocument& rDoc, const
         double n = pCalc->GetValue();
         sal_uInt32 nFormat = aFormatter.GetStandardFormat( n, 0,
                 pCalc->GetFormatType(), ScGlobal::eLnge );
-        aFormatter.GetInputLineString( n, nFormat, aValue );
+        aValue = aFormatter.GetInputLineString( n, nFormat );
         //! display OutputString but insert InputLineString
     }
     else
diff --git a/sc/source/ui/condformat/colorformat.cxx 
b/sc/source/ui/condformat/colorformat.cxx
index 7257fca2b469..ff8afff2d48f 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -51,9 +51,7 @@ void GetType(const weld::ComboBox& rLstBox, const 
weld::Entry& rEd, ScColorScale
 OUString convertNumberToString(double nVal, const ScDocument* pDoc)
 {
     SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable();
-    OUString aText;
-    pNumberFormatter->GetInputLineString(nVal, 0, aText);
-    return aText;
+    return pNumberFormatter->GetInputLineString(nVal, 0);
 }
 
 void SetValue( const ScDocument* pDoc, const ScColorScaleEntry* pEntry, 
weld::Entry& rEdit)
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index f04706364cac..c9b5e208ffa5 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -486,9 +486,7 @@ namespace {
 OUString convertNumberToString(double nVal, const ScDocument* pDoc)
 {
     SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable();
-    OUString aText;
-    pNumberFormatter->GetInputLineString(nVal, 0, aText);
-    return aText;
+    return pNumberFormatter->GetInputLineString(nVal, 0);
 }
 
 const struct
@@ -955,8 +953,7 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, 
weld::ComboBox& rLbT
             {
                 double nVal = rEntry.GetValue();
                 SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable();
-                OUString aText;
-                pNumberFormatter->GetInputLineString(nVal, 0, aText);
+                OUString aText = pNumberFormatter->GetInputLineString(nVal, 0);
                 rEdit.set_text(aText);
             }
             break;
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 1382057b4524..9735b15c711e 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -1540,17 +1540,15 @@ void ScFilterDlg::SetValString( const OUString& 
rQueryStr, const ScQueryEntry::I
         if (rItem.meType == ScQueryEntry::ByValue)
         {
             if (pDoc)
-            {
-                pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, 
rValStr);
-            }
+                rValStr = 
pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0);
         }
         else if (rItem.meType == ScQueryEntry::ByDate)
         {
             if (pDoc)
             {
                 SvNumberFormatter* pFormatter = pDoc->GetFormatTable();
-                pFormatter->GetInputLineString(rItem.mfVal,
-                                               pFormatter->GetStandardFormat( 
SvNumFormatType::DATE), rValStr);
+                rValStr = pFormatter->GetInputLineString(rItem.mfVal,
+                                               pFormatter->GetStandardFormat( 
SvNumFormatType::DATE));
             }
         }
         else
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx 
b/sc/source/ui/miscdlgs/filldlg.cxx
index 9bcc5bfbf6ed..38cfb3782b32 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -169,13 +169,12 @@ void ScFillSeriesDlg::Init( sal_uInt16 nPossDir )
 
     m_xEdStartVal->set_text( aStartStrVal);
 
-    OUString aIncrTxt;
-    rDoc.GetFormatTable()->GetInputLineString( fIncrement, 0, aIncrTxt );
+    OUString aIncrTxt = rDoc.GetFormatTable()->GetInputLineString( fIncrement, 
0 );
     m_xEdIncrement->set_text( aIncrTxt );
 
     OUString aEndTxt;
     if ( fEndVal != MAXDOUBLE )
-        rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0, aEndTxt );
+        aEndTxt = rDoc.GetFormatTable()->GetInputLineString( fEndVal, 0 );
     m_xEdEndVal->set_text( aEndTxt );
 }
 
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 248c1763badf..9cc4117ed403 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5373,8 +5373,7 @@ void SAL_CALL ScCellRangeObj::filter( const 
uno::Reference<sheet::XSheetFilterDe
             ScQueryEntry::Item& rItem = rItems.front();
             if (rItem.meType != ScQueryEntry::ByString)
             {
-                OUString aStr;
-                
pDocSh->GetDocument().GetFormatTable()->GetInputLineString(rItem.mfVal, 0, 
aStr);
+                OUString aStr = 
pDocSh->GetDocument().GetFormatTable()->GetInputLineString(rItem.mfVal, 0);
                 rItem.maString = rPool.intern(aStr);
             }
         }
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 170f1a58993d..db8946232706 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1085,8 +1085,7 @@ void fillQueryParam(
 
             if (rItem.meType == ScQueryEntry::ByValue)
             {
-                OUString aStr;
-                pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0, 
aStr);
+                OUString aStr = 
pDoc->GetFormatTable()->GetInputLineString(rItem.mfVal, 0);
                 rItem.maString = rPool.intern(aStr);
             }
         }
@@ -1142,8 +1141,7 @@ void fillQueryParam(
 
                 if (aItem.meType == ScQueryEntry::ByValue)
                 {
-                    OUString aStr;
-                    pDoc->GetFormatTable()->GetInputLineString(aItem.mfVal, 0, 
aStr);
+                    OUString aStr = 
pDoc->GetFormatTable()->GetInputLineString(aItem.mfVal, 0);
                     aItem.maString = rPool.intern(aStr);
                 }
                 else if (aItem.meType == ScQueryEntry::ByTextColor
@@ -1321,8 +1319,7 @@ void SAL_CALL ScFilterDescriptorBase::setFilterFields(
 
         if (rItem.meType != ScQueryEntry::ByString)
         {
-            OUString aStr;
-            rDoc.GetFormatTable()->GetInputLineString(rItem.mfVal, 0, aStr);
+            OUString aStr = 
rDoc.GetFormatTable()->GetInputLineString(rItem.mfVal, 0);
             rItem.maString = rPool.intern(aStr);
         }
 
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 7d433aa7329e..b42e8261194c 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1218,8 +1218,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
                 sal_uInt32 nIndex = aNumberFormatter.GetFormatIndex( 
NF_NUMBER_SYSTEM );
                 if ( seqValue.hasElements() )
                 {
-                    OUString sValue;
-                    aNumberFormatter.GetInputLineString( seqValue[0], nIndex, 
sValue );
+                    OUString sValue = aNumberFormatter.GetInputLineString( 
seqValue[0], nIndex );
                     m_xShowSizeFT->set_label( CreateSizeText( sValue.toInt64( 
) ) );
                 }
             }
@@ -1926,7 +1925,7 @@ void CustomPropertiesWindow::ReloadLinesContent()
         else if (rAny >>= nTmpValue)
         {
             sal_uInt32 nIndex = 
m_aNumberFormatter.GetFormatIndex(NF_NUMBER_SYSTEM);
-            m_aNumberFormatter.GetInputLineString(nTmpValue, nIndex, sValue);
+            sValue = m_aNumberFormatter.GetInputLineString(nTmpValue, nIndex);
             pLine->m_xValueEdit->set_text(sValue);
             nType = Custom_Type_Number;
         }
@@ -2314,8 +2313,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, 
const OUString& sName,
         sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( 
NF_NUMBER_SYSTEM );
         for (const auto& rValue : seqValue)
         {
-            OUString sValue;
-            m_aNumberFormatter.GetInputLineString( rValue, nIndex, sValue );
+            OUString sValue = m_aNumberFormatter.GetInputLineString( rValue, 
nIndex );
             std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), 
sValue));
             pValue->m_xValueEdit->set_editable(bUpdatable);
             pNewLine->m_aValues.push_back( std::move(pValue) );
@@ -2328,8 +2326,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, 
const OUString& sName,
         sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( 
NF_NUMBER_SYSTEM );
         for (const auto& rValue : seqValue)
         {
-            OUString sValue;
-            m_aNumberFormatter.GetInputLineString( rValue, nIndex, sValue );
+            OUString sValue = m_aNumberFormatter.GetInputLineString( rValue, 
nIndex );
             std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), 
sValue));
             pValue->m_xValueEdit->set_editable(bUpdatable);
             pNewLine->m_aValues.push_back( std::move(pValue) );
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 840187eca4ee..68469c4e9fc4 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -255,14 +255,11 @@ OUString SAL_CALL 
SvNumberFormatterServiceObj::getInputString( sal_Int32 nKey, d
 {
     ::osl::MutexGuard aGuard( m_aMutex );
 
-    OUString aRet;
     SvNumberFormatter* pFormatter = xSupplier.is() ? 
xSupplier->GetNumberFormatter() : nullptr;
     if (!pFormatter)
         throw uno::RuntimeException();
 
-    pFormatter->GetInputLineString(fValue, nKey, aRet);
-
-    return aRet;
+    return pFormatter->GetInputLineString(fValue, nKey);
 }
 
 // XNumberFormatPreviewer
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index d15201f9c505..bc012180f0f7 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1943,14 +1943,14 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double 
fNumber, sal_uInt32 nFIndex,
                                      eType, pFormat, eForLocale);
 }
 
-void SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage,
+OUString SvNFEngine::GetInputLineString(SvNFLanguageData& rCurrentLanguage,
                                     const SvNFFormatData& rFormatData,
                                     const NativeNumberWrapper& rNatNum, const 
Accessor& rFuncs,
                                     const double& fOutNumber,
                                     sal_uInt32 nFIndex,
-                                    OUString& sOutString,
                                     bool bFiltering, bool bForceSystemLocale)
 {
+    OUString sOutString;
     const Color* pColor;
     sal_uInt32 nRealKey = nFIndex;
 
@@ -2032,16 +2032,16 @@ void SvNFEngine::GetInputLineString(SvNFLanguageData& 
rCurrentLanguage,
     {
         rCurrentLanguage.ChangeStandardPrec(nOldPrec);
     }
+    return sOutString;
 }
 
-void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
+OUString SvNumberFormatter::GetInputLineString(const double& fOutNumber,
                                            sal_uInt32 nFIndex,
-                                           OUString& sOutString,
                                            bool bFiltering, bool 
bForceSystemLocale)
 {
     ::osl::MutexGuard aGuard( GetInstanceMutex() );
-    SvNFEngine::GetInputLineString(m_aCurrentLanguage, m_aFormatData, 
GetNatNum(),
-                                   m_aRWPolicy, fOutNumber, nFIndex, 
sOutString,
+    return SvNFEngine::GetInputLineString(m_aCurrentLanguage, m_aFormatData, 
GetNatNum(),
+                                   m_aRWPolicy, fOutNumber, nFIndex,
                                    bFiltering, bForceSystemLocale);
 }
 
diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index d165a8922f02..c5603057da8b 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -919,8 +919,7 @@ OString HTMLOutFuncs::CreateTableDataOptionsValNum(
     if ( bValue )
     {
         // printf / scanf is not precise enough
-        OUString aValStr;
-        rFormatter.GetInputLineString( fVal, 0, aValStr );
+        OUString aValStr = rFormatter.GetInputLineString( fVal, 0 );
         OString sTmp(OUStringToOString(aValStr, RTL_TEXTENCODING_UTF8));
         aStrTD.append(" " OOO_STRING_SVTOOLS_HTML_O_SDval "=\"" +
                 sTmp + "\"");
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index fa3192d284b6..4751da68dd47 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -657,11 +657,7 @@ OUString SwValueFieldType::GetInputOrDateTime( const 
OUString& rInput, const dou
         SvNumberFormatter* pFormatter = m_pDoc->GetNumberFormatter();
         const SvNumberformat* pEntry = pFormatter->GetEntry(nFormat);
         if (pEntry && (pEntry->GetType() & SvNumFormatType::DATETIME))
-        {
-            OUString aEdit;
-            pFormatter->GetInputLineString( rVal, nFormat, aEdit);
-            return aEdit;
-        }
+            return pFormatter->GetInputLineString( rVal, nFormat );
     }
     return rInput;
 }
diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index 5551280c7aca..ec8f5569ecab 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -306,7 +306,7 @@ void Formatter::SetTextFormatted(const OUString& rStr)
     if( IsUsingInputStringForFormatting() &&
         GetOrCreateFormatter()->IsNumberFormat(m_sCurrentTextValue, 
nTempFormatKey, dNumber) )
     {
-        GetOrCreateFormatter()->GetInputLineString(dNumber, m_nFormatKey, 
sFormatted);
+        sFormatted = GetOrCreateFormatter()->GetInputLineString(dNumber, 
m_nFormatKey);
     }
     else
     {
@@ -774,7 +774,7 @@ void Formatter::ImplSetValue(double dVal, bool bForce)
         {
             if( IsUsingInputStringForFormatting())
             {
-                GetOrCreateFormatter()->GetInputLineString(dVal, m_nFormatKey, 
sNewText);
+                sNewText = GetOrCreateFormatter()->GetInputLineString(dVal, 
m_nFormatKey);
             }
             else
             {

Reply via email to