summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-03 14:09:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-03 15:32:53 +0200
commitc5a0b7af847a71fd50f713934b29305f8ce96c6b (patch)
treed7c0193bc183250c36e467f830a4327ab94dc24e /sc/source/ui
parentd19dbcc139d18771e5e20e82a694f1512476e41c (diff)
loplugin:stringadd improvement for appending numbers
I was wrong, the Concat framework already optimised appending numbers by stack-allocating small buffers, so include them in the plugin Change-Id: I922edbdde273c89abfe21d51c5d25dc01c97db25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115037 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dbgui/asciiopt.cxx12
-rw-r--r--sc/source/ui/miscdlgs/dataproviderdlg.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx12
3 files changed, 13 insertions, 13 deletions
diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx
index 270ca6b01069..4d9e8dea6fe8 100644
--- a/sc/source/ui/dbgui/asciiopt.cxx
+++ b/sc/source/ui/dbgui/asciiopt.cxx
@@ -211,24 +211,24 @@ OUString ScAsciiOptions::WriteToString() const
aOutStr.append(ScGlobal::GetCharsetString( eCharSet ));
//Token 3: Number of start row.
- aOutStr.append(",").append(nStartRow).append(",");
+ aOutStr.append("," + OUString::number(nStartRow) + ",");
//Token 4: Column info.
for (size_t nInfo=0; nInfo<mvColStart.size(); nInfo++)
{
if (nInfo)
aOutStr.append("/");
- aOutStr.append(mvColStart[nInfo])
- .append("/")
- .append(static_cast<sal_Int32>(mvColFormat[nInfo]));
+ aOutStr.append(OUString::number(mvColStart[nInfo]) +
+ "/" +
+ OUString::number(mvColFormat[nInfo]));
}
// #i112025# the options string is used in macros and linked sheets,
// so new options must be added at the end, to remain compatible
- aOutStr.append(",")
+ aOutStr.append("," +
//Token 5: Language
- .append(static_cast<sal_Int32>(static_cast<sal_uInt16>(eLang))).append("," +
+ OUString::number(static_cast<sal_uInt16>(eLang)) + "," +
//Token 6: Import quoted field as text.
OUString::boolean( bQuotedFieldAsText ) + "," +
//Token 7: Detect special numbers.
diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
index fe8809f144e1..85d58a907527 100644
--- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx
+++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
@@ -301,7 +301,7 @@ ScMergeColumnTransformationControl::ScMergeColumnTransformationControl(
aBuffer.append(static_cast<sal_Int32>(nStartCol + 1));
for ( SCCOL nCol = nStartCol + 1; nCol <= nEndCol; ++nCol)
{
- aBuffer.append(";").append(static_cast<sal_Int32>(nCol + 1));
+ aBuffer.append(";" + OUString::number(nCol + 1));
}
mxEdColumns->set_text(aBuffer.makeStringAndClear());
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index b727d817e185..4fb5d812c8af 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2410,12 +2410,12 @@ void lcl_createGroupsData(
bool bGroupHidden = pEntry->IsHidden();
- rGroupsBuffer
- .append("{ \"level\": ").append(sal_Int32(nLevel + 1)).append(", "
- "\"index\": ").append(sal_Int32(nIndex)).append(", "
- "\"startPos\": ").append(rGroupStartPositions[nLevel]).append(", "
- "\"endPos\": ").append(nTotalPx).append(", "
- "\"hidden\": ").append(sal_Int32(bGroupHidden ? 1 : 0)).append(" }");
+ rGroupsBuffer.append(
+ "{ \"level\": " + OString::number(nLevel + 1) + ", "
+ "\"index\": " + OString::number(nIndex) + ", "
+ "\"startPos\": " + OString::number(rGroupStartPositions[nLevel]) + ", "
+ "\"endPos\": " + OString::number(nTotalPx) + ", "
+ "\"hidden\": " + OString::number(bGroupHidden ? 1 : 0) + " }");
// look for the next visible group control at level nLevel
bool bFound = false;