summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
Diffstat (limited to 'svl')
-rw-r--r--svl/qa/unit/lockfiles/test_lockfiles.cxx2
-rw-r--r--svl/source/misc/documentlockfile.cxx2
-rw-r--r--svl/source/misc/lockfilecommon.cxx4
-rw-r--r--svl/source/numbers/zformat.cxx8
4 files changed, 8 insertions, 8 deletions
diff --git a/svl/qa/unit/lockfiles/test_lockfiles.cxx b/svl/qa/unit/lockfiles/test_lockfiles.cxx
index 5d2661ca00be..91920344d248 100644
--- a/svl/qa/unit/lockfiles/test_lockfiles.cxx
+++ b/svl/qa/unit/lockfiles/test_lockfiles.cxx
@@ -79,7 +79,7 @@ OUString readLockFile(const OUString& aSource)
aFileStream.ReadBytes(pBuffer.get(), nSize);
css::uno::Sequence<sal_Int8> aData(pBuffer.get(), nSize);
- OStringBuffer aResult;
+ OStringBuffer aResult(static_cast<int>(nSize));
for (sal_Int8 nByte : aData)
{
aResult.append(static_cast<sal_Char>(nByte));
diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx
index bc3fe86ef819..935a568310fc 100644
--- a/svl/source/misc/documentlockfile.cxx
+++ b/svl/source/misc/documentlockfile.cxx
@@ -178,7 +178,7 @@ void DocumentLockFile::WriteEntryToStream( const LockFileEntry& aEntry, const un
{
::osl::MutexGuard aGuard( m_aMutex );
- OUStringBuffer aBuffer;
+ OUStringBuffer aBuffer(256);
for ( LockFileComponent lft : o3tl::enumrange<LockFileComponent>() )
{
diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx
index e27c1113d975..8daf3f3549b9 100644
--- a/svl/source/misc/lockfilecommon.cxx
+++ b/svl/source/misc/lockfilecommon.cxx
@@ -130,7 +130,7 @@ LockFileEntry LockFileCommon::ParseEntry( const uno::Sequence< sal_Int8 >& aBuff
OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& io_nCurPos )
{
- OStringBuffer aResult;
+ OStringBuffer aResult(128);
bool bHaveName = false;
bool bEscape = false;
@@ -168,7 +168,7 @@ OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sa
OUString LockFileCommon::EscapeCharacters( const OUString& aSource )
{
- OUStringBuffer aBuffer;
+ OUStringBuffer aBuffer(aSource.getLength()*2);
const sal_Unicode* pStr = aSource.getStr();
for ( sal_Int32 nInd = 0; nInd < aSource.getLength() && pStr[nInd] != 0; nInd++ )
{
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,