summaryrefslogtreecommitdiff
path: root/svl/source/numbers
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/numbers')
-rw-r--r--svl/source/numbers/zforlist.cxx29
-rw-r--r--svl/source/numbers/zformat.cxx4
2 files changed, 16 insertions, 17 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 9a0660f74e24..04e32464d8b2 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -2719,28 +2719,27 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
const NfKeywordTable & rKeyword = pFormatScanner->GetKeywords();
i18n::NumberFormatCode aSingleFormatCode;
- OUStringBuffer aBuf;
aSingleFormatCode.Usage = i18n::KNumberFormatUsage::DATE_TIME;
// YYYY-MM-DD HH:MM:SS ISO (with blank instead of 'T')
- aBuf.append( rKeyword[NF_KEY_YYYY]).append('-').
- append( rKeyword[NF_KEY_MM]).append('-').
- append( rKeyword[NF_KEY_DD]).append(' ').
- append( rKeyword[NF_KEY_HH]).append(':').
- append( rKeyword[NF_KEY_MMI]).append(':').
- append( rKeyword[NF_KEY_SS]);
- aSingleFormatCode.Code = aBuf.makeStringAndClear();
+ aSingleFormatCode.Code =
+ rKeyword[NF_KEY_YYYY] + "-" +
+ rKeyword[NF_KEY_MM] + "-" +
+ rKeyword[NF_KEY_DD] + " " +
+ rKeyword[NF_KEY_HH] + ":" +
+ rKeyword[NF_KEY_MMI] + ":" +
+ rKeyword[NF_KEY_SS];
ImpInsertFormat( aSingleFormatCode,
CLOffset + ZF_STANDARD_DATETIME+2 /* NF_DATETIME_ISO_YYYYMMDD_HHMMSS */ );
// YYYY-MM-DD"T"HH:MM:SS ISO
- aBuf.append( rKeyword[NF_KEY_YYYY]).append('-').
- append( rKeyword[NF_KEY_MM]).append('-').
- append( rKeyword[NF_KEY_DD]).append("\"T\"").
- append( rKeyword[NF_KEY_HH]).append(':').
- append( rKeyword[NF_KEY_MMI]).append(':').
- append( rKeyword[NF_KEY_SS]);
- aSingleFormatCode.Code = aBuf.makeStringAndClear();
+ aSingleFormatCode.Code =
+ rKeyword[NF_KEY_YYYY] + "-" +
+ rKeyword[NF_KEY_MM] + "-" +
+ rKeyword[NF_KEY_DD] + "\"T\"" +
+ rKeyword[NF_KEY_HH] + ":" +
+ rKeyword[NF_KEY_MMI] + ":" +
+ rKeyword[NF_KEY_SS];
SvNumberformat* pFormat = ImpInsertFormat( aSingleFormatCode,
CLOffset + ZF_STANDARD_DATETIME+3 /* NF_DATETIME_ISO_YYYYMMDDTHHMMSS */ );
assert(pFormat);
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 63a8b5d9e3ab..41db17082089 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;
+ OUStringBuffer sBuffSymbol(32);
const NfKeywordTable & rKeywords = rScan.GetKeywords();
while (nPos < nLen && eState != SsStop)
@@ -1975,7 +1975,7 @@ bool SvNumberformat::GetNewCurrencySymbol( OUString& rSymbol,
// static
OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr )
{
- OUStringBuffer aTmp;
+ OUStringBuffer aTmp(rStr.getLength());
sal_Int32 nStartPos, nPos, nLen;
nLen = rStr.getLength();
nStartPos = 0;