diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-21 13:48:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-22 21:42:14 +0200 |
commit | 75997f13ee3a71d6c994392264b0190bd7bb6756 (patch) | |
tree | 4dc35a2e62e41d4b1f7953367419ff3fb072635f /sc | |
parent | b546af03ab9e371c70ce72562bc0a492972a8585 (diff) |
no need to create temporaries when appending number to O[U]StringBuffer
Change-Id: I36d82423b5f75010552696a66cec7e53ee265ce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114395
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/address.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/compiler.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/excel/xehelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/asciiopt.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/dbgui/csvruler.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/dataproviderdlg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/filtuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 4 |
9 files changed, 20 insertions, 20 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index fb086018a972..06ffd08c7d44 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2505,7 +2505,7 @@ OUString ScAddress::GetColRowString() const case formula::FormulaGrammar::CONV_XL_A1: case formula::FormulaGrammar::CONV_XL_OOX: lcl_ScColToAlpha( aString, nCol); - aString.append(OUString::number(nRow+1)); + aString.append(nRow+1); break; case formula::FormulaGrammar::CONV_XL_R1C1: diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 1ee6b9ec9592..233038b90c24 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1602,7 +1602,7 @@ struct ConventionXL_OOX : public ConventionXL_A1 static void makeExternalDocStr( OUStringBuffer& rBuffer, sal_uInt16 nFileId ) { - rBuffer.append('[').append( OUString::number( nFileId+1)).append(']'); + rBuffer.append('[').append( static_cast<sal_Int32>(nFileId+1) ).append(']'); } }; @@ -1616,10 +1616,10 @@ r1c1_add_col( OUStringBuffer &rBuf, const ScSingleRefData& rRef, const ScAddress { SCCOL nCol = rRef.Col(); if (nCol != 0) - rBuf.append("[").append(OUString::number(nCol)).append("]"); + rBuf.append("[").append(static_cast<sal_Int32>(nCol)).append("]"); } else - rBuf.append( OUString::number( rAbsRef.Col() + 1 ) ); + rBuf.append( static_cast<sal_Int32>(rAbsRef.Col() + 1) ); } static void r1c1_add_row( OUStringBuffer &rBuf, const ScSingleRefData& rRef, const ScAddress& rAbsRef ) @@ -1629,11 +1629,11 @@ r1c1_add_row( OUStringBuffer &rBuf, const ScSingleRefData& rRef, const ScAddress { if (rRef.Row() != 0) { - rBuf.append("[").append( OUString::number(rRef.Row()) ).append("]"); + rBuf.append("[").append(rRef.Row() ).append("]"); } } else - rBuf.append( OUString::number( rAbsRef.Row() + 1 ) ); + rBuf.append( rAbsRef.Row() + 1 ); } namespace { diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 3c3b2834e0db..d7b769e2c811 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -760,7 +760,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico aNewData.mnHeight = (aNewData.mnHeight + 10) / 20; bool bFontHtChanged = (aFontData.mnHeight != aNewData.mnHeight); if( bFontHtChanged ) - aParaText.append("&").append(OUString::number( aNewData.mnHeight )); + aParaText.append("&").append( static_cast<sal_Int32>(aNewData.mnHeight) ); // update maximum paragraph height, convert to twips nParaHeight = ::std::max< sal_Int32 >( nParaHeight, aNewData.mnHeight * 20 ); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 063909501f1b..168334f5cce9 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1381,7 +1381,7 @@ void ScInputHandler::ShowFuncList( const ::std::vector< OUString > & rFuncStrVec { aPayload.append("{"); aPayload.append("\"index\": "); - aPayload.append(OString::number(nCurIndex)); + aPayload.append(static_cast<sal_Int64>(nCurIndex)); aPayload.append(", "); aPayload.append("\"signature\": \""); aPayload.append(escapeJSON(ppFDesc->getSignature())); diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index d2082706d917..5dcb1cbd251f 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -192,7 +192,7 @@ OUString ScAsciiOptions::WriteToString() const { if (i) aOutStr.append("/"); - aOutStr.append(OUString::number(aFieldSeps[i])); + aOutStr.append(aFieldSeps[i]); } if ( bMergeFieldSeps ) { @@ -202,7 +202,7 @@ OUString ScAsciiOptions::WriteToString() const } // Token 1: Text Quote character. - aOutStr.append(",").append(OUString::number(cTextSep)).append(","); + aOutStr.append(",").append(cTextSep).append(","); //Token 2: Text encoding. if ( bCharSetSystem ) // force "SYSTEM" @@ -211,16 +211,16 @@ OUString ScAsciiOptions::WriteToString() const aOutStr.append(ScGlobal::GetCharsetString( eCharSet )); //Token 3: Number of start row. - aOutStr.append(",").append(OUString::number(nStartRow)).append(","); + aOutStr.append(",").append(nStartRow).append(","); //Token 4: Column info. for (size_t nInfo=0; nInfo<mvColStart.size(); nInfo++) { if (nInfo) aOutStr.append("/"); - aOutStr.append(OUString::number(mvColStart[nInfo])) + aOutStr.append(mvColStart[nInfo]) .append("/") - .append(OUString::number(mvColFormat[nInfo])); + .append(static_cast<sal_Int32>(mvColFormat[nInfo])); } // #i112025# the options string is used in macros and linked sheets, @@ -228,7 +228,7 @@ OUString ScAsciiOptions::WriteToString() const aOutStr.append(",") //Token 5: Language - .append(OUString::number(static_cast<sal_uInt16>(eLang))).append(",") + .append(static_cast<sal_Int32>(static_cast<sal_uInt16>(eLang))).append(",") //Token 6: Import quoted field as text. .append(OUString::boolean( bQuotedFieldAsText )).append(",") //Token 7: Detect special numbers. diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index 3b8a1a808399..7259b9e44add 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -73,7 +73,7 @@ static void save_FixedWidthList(const ScCsvSplits& rSplits) sal_uInt32 n = rSplits.Count(); for (sal_uInt32 i = 0; i < n; ++i) { - sSplits.append(OUString::number(rSplits[i])); + sSplits.append(rSplits[i]); sSplits.append(";"); } diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx b/sc/source/ui/miscdlgs/dataproviderdlg.cxx index 0ceee8cee473..fe8809f144e1 100644 --- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx +++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx @@ -298,10 +298,10 @@ ScMergeColumnTransformationControl::ScMergeColumnTransformationControl( OUStringBuffer aBuffer; // map from zero based to one based column numbers - aBuffer.append(OUString::number(nStartCol + 1)); + aBuffer.append(static_cast<sal_Int32>(nStartCol + 1)); for ( SCCOL nCol = nStartCol + 1; nCol <= nEndCol; ++nCol) { - aBuffer.append(";").append(OUString::number(nCol + 1)); + aBuffer.append(";").append(static_cast<sal_Int32>(nCol + 1)); } mxEdColumns->set_text(aBuffer.makeStringAndClear()); diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 20701fdea1df..1e6119ecb36d 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -213,7 +213,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() LanguageType eLang = pDlg->GetLanguageType(); OUStringBuffer aBuf; - aBuf.append(OUString::number(static_cast<sal_uInt16>(eLang))); + aBuf.append(static_cast<sal_Int32>(static_cast<sal_uInt16>(eLang))); aBuf.append(' '); aBuf.append(pDlg->IsDateConversionSet() ? u'1' : u'0'); aFilterOptions = aBuf.makeStringAndClear(); diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 433ce133997d..b98440d9e552 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -125,10 +125,10 @@ void lcl_lokGetWholeFunctionList() { aPayload.append("{"); aPayload.append("\"index\": "); - aPayload.append(OString::number(nCurIndex)); + aPayload.append(static_cast<sal_Int64>(nCurIndex)); aPayload.append(", "); aPayload.append("\"category\": "); - aPayload.append(OString::number(ppFDesc->getCategory()->getNumber())); + aPayload.append(static_cast<sal_Int64>(ppFDesc->getCategory()->getNumber())); aPayload.append(", "); aPayload.append("\"signature\": \""); aPayload.append(escapeJSON(ppFDesc->getSignature())); |