summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-08-01 15:24:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-08-01 18:25:02 +0200
commitbfa513d4f5d3a3a7115abee877c8f7e27e3d87ab (patch)
treedd24d0e2f14f6534cf02f1eab441ec7ab151f40a /sc
parent35525170867ccbeb9503a23aa7f800daba5cc346 (diff)
optimise ScTable::dumpColumnRowSizes a little
use an OStringBuffer to accumulate the result Change-Id: I7d585b48183208200c62fe4f1d9e639cc3b1d466 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171376 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 4726058aa522bf72df4938bf76075ff68f8bacc3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171356 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table7.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index f9e7a878c8e5..451c1895c194 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -527,8 +527,7 @@ OString ScTable::dumpColumnRowSizes(bool bColumns)
// instead just operate on the specialized object.
typedef ScCompressedArray<SCCOL, sal_uInt16> ColWidthsType;
auto dumpColWidths = [this](const ColWidthsType& rWidths) -> OString {
- OString aOutput;
- OString aSegment;
+ OStringBuffer aOutput;
SCCOL nStartCol = 0;
const SCCOL nMaxCol = std::min(rWidths.GetLastPos(), GetDoc().MaxCol());
size_t nDummy = 0;
@@ -539,12 +538,11 @@ OString ScTable::dumpColumnRowSizes(bool bColumns)
// The last span nEndCol is always MAXCOL+1 for some reason, and we don't want that.
if (nEndCol > nMaxCol)
nEndCol = nMaxCol;
- aSegment = OString::number(nWidth) + ":" + OString::number(nEndCol) + " ";
- aOutput += aSegment;
+ aOutput.append(OString::number(nWidth) + ":" + OString::number(nEndCol) + " ");
nStartCol = nEndCol + 1;
}
- return aOutput;
+ return aOutput.makeStringAndClear();
};
if (bColumns)