summaryrefslogtreecommitdiff
path: root/svl/source/numbers
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2019-10-17 20:33:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-26 12:38:33 +0200
commite276c812648bf511d6c4813d6fd82a00391cfdac (patch)
treeadbf24f41bef128a081cc1cc117c8023a3eed65d /svl/source/numbers
parentd04f044f05b4d13c3c6ea3f33fddd9c05a0ab3ad (diff)
size some stringbuffer to prevent re-alloc
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/numbers')
-rw-r--r--svl/source/numbers/zformat.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 41db17082089..1f7db49ccec1 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1647,7 +1647,7 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString,
sal_Unicode cLetter = ' '; // Preliminary result
sal_Int32 nLen = rString.getLength();
ScanState eState = SsStart;
- OUStringBuffer sBuffSymbol(32);
+ OUStringBuffer sBuffSymbol(64);
const NfKeywordTable & rKeywords = rScan.GetKeywords();
while (nPos < nLen && eState != SsStop)
@@ -2426,7 +2426,7 @@ bool SvNumberformat::GetOutputString(double fNumber,
Color** ppColor)
{
bool bRes = false;
- OUStringBuffer sBuff;
+ OUStringBuffer sBuff(64);
OutString.clear();
*ppColor = nullptr; // No color change
if (eType & SvNumFormatType::LOGICAL)
@@ -5523,10 +5523,10 @@ void SvNumberformat::impTransliterateImpl(OUStringBuffer& rStr,
{
css::lang::Locale aLocale( LanguageTag( rNum.GetLang() ).getLocale() );
- OUString sTemp(rStr.makeStringAndClear());
+ OUString sTemp(rStr.toString());
sTemp = GetFormatter().GetNatNum()->getNativeNumberStringParams(
sTemp, aLocale, rNum.GetNatNum(), rNum.GetParams());
- rStr.append(sTemp);
+ rStr = sTemp;
}
OUString SvNumberformat::impTransliterateImpl(const OUString& rStr,