diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-12-26 10:03:40 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-12-26 20:36:26 +0100 |
commit | a23a7eea5cfcdc50d09be248828cb1e6293e5ebb (patch) | |
tree | e415782b558350673175f80836d022c4882c9a7d /sc | |
parent | cc517c687de7205487936d40b64481107656f239 (diff) |
Avoid OUStringBuffer::toString where possible
Change-Id: I99abbe97a48b2077e28d6221fb70036e5e412657
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127479
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/calcconfig.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/dif/difimp.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/html/htmlimp.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 5 |
5 files changed, 10 insertions, 11 deletions
diff --git a/sc/source/core/tool/calcconfig.cxx b/sc/source/core/tool/calcconfig.cxx index 2b0ff8c2e19e..adb51efdf1ff 100644 --- a/sc/source/core/tool/calcconfig.cxx +++ b/sc/source/core/tool/calcconfig.cxx @@ -199,7 +199,7 @@ OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes) result.append(pOpCodeMap->getSymbol(*i)); } - return result.toString(); + return result.makeStringAndClear(); } ScCalcConfig::OpCodeSet ScStringToOpCodeSet(std::u16string_view rOpCodes) diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 5f7178b9fe8a..ed222fdb5852 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -129,6 +129,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportDif(SvStream& rIn, ScDocument* pDoc, c ScSetStringParam aStrParam; // used to set string value without number detection. aStrParam.setTextInput(); + const OUString aData = rData.makeStringAndClear(); while( eCurrent != D_EOD ) { @@ -137,8 +138,6 @@ ErrCode ScFormatFilterPluginImpl::ScImportDif(SvStream& rIn, ScDocument* pDoc, c aPrgrsBar.Progress(); ScAddress aPos(nColCnt, nRowCnt, nBaseTab); - OUString aData = rData.toString(); - switch( eCurrent ) { case D_BOT: @@ -391,7 +390,7 @@ static void lcl_DeEscapeQuotesDif(OUStringBuffer& rString) // escape quotes in strings (and Excel doesn't when using the clipboard). // The quotes around the string are removed before this function is called. - rString = rString.toString().replaceAll("\"\"", "\""); + rString = rString.makeStringAndClear().replaceAll("\"\"", "\""); } // Determine if passed in string is numeric data and set fVal/nNumFormat if so diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 5e1af28b04d9..57b92e0d5ef9 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -188,10 +188,9 @@ void ScHTMLImport::WriteToDocument( // insert table caption as name if (!pTable->GetTableCaption().isEmpty()) aName.append(" - " + pTable->GetTableCaption()); - if (!mpDoc->GetRangeName()->findByUpperName( - ScGlobal::getCharClass().uppercase(aName.toString()))) - InsertRangeName(*mpDoc, aName.toString(), aNewRange); - + const OUString sName(aName.makeStringAndClear()); + if (!mpDoc->GetRangeName()->findByUpperName(ScGlobal::getCharClass().uppercase(sName))) + InsertRangeName(*mpDoc, sName, aNewRange); } } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 31b49b1faf4f..be6f7178f094 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5428,7 +5428,7 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi ) pData->GetName(aName); // adjust relative references to the left column in Excel-compliant way: pData->UpdateSymbol(aContent, ScAddress( nStartCol, nOutRow, nTab )); - aFormula = "=" + aContent.toString(); + aFormula = "=" + aContent; ScSetStringParam aParam; aParam.setTextInput(); rDoc.SetString(ScAddress(nStartCol,nOutRow,nTab), aName, &aParam); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index c75739ed79df..9d7cc3351c6e 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -483,9 +483,10 @@ void ScEditShell::Execute( SfxRequest& rReq ) { aBuffer.append(rName).append(' '); } - pTableView->InsertText(aBuffer.toString()); + const OUString s = aBuffer.makeStringAndClear(); + pTableView->InsertText(s); if (pTopView) - pTopView->InsertText(aBuffer.makeStringAndClear()); + pTopView->InsertText(s); } } pDlg.disposeAndClear(); |