summaryrefslogtreecommitdiff
path: root/oox/source/ole
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-11-03 17:11:32 +0100
commit48101a1a0d574db3db1f99c782bd67e885b232bb (patch)
treeafd2f88944d73f43762b3a31df2ff81c8115ba9e /oox/source/ole
parentab285c743afa1c8769581871d7b56374fd8c49f1 (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. Change-Id: I55fe36b31cd3d40f86e5729337a927cf920f2af6 Reviewed-on: https://gerrit.libreoffice.org/81960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/ole')
-rw-r--r--oox/source/ole/olehelper.cxx2
-rw-r--r--oox/source/ole/vbamodule.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index d2dd4899d2e6..05b787d9f85a 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -261,7 +261,7 @@ void OleHelper::exportGuid( BinaryOutputStream& rOStr, const SvGlobalName& rId )
OUString OleHelper::importGuid( BinaryInputStream& rInStrm )
{
- OUStringBuffer aBuffer;
+ OUStringBuffer aBuffer(40);
aBuffer.append( '{' );
lclAppendHex( aBuffer, rInStrm.readuInt32() );
aBuffer.append( '-' );
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index b7ff5edb7aec..82a368934794 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -143,7 +143,7 @@ void VbaModule::createEmptyModule( const Reference< container::XNameContainer >&
OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const
{
- OUStringBuffer aSourceCode;
+ OUStringBuffer aSourceCode(512);
static const char sUnmatchedRemovedTag[] = "Rem removed unmatched Sub/End: ";
if( !maStreamName.isEmpty() && (mnOffset != SAL_MAX_UINT32) )
{
@@ -264,7 +264,7 @@ void VbaModule::createModule( const OUString& rVBASourceCode,
// prepare the Basic module
script::ModuleInfo aModuleInfo;
aModuleInfo.ModuleType = mnType;
- OUStringBuffer aSourceCode;
+ OUStringBuffer aSourceCode(512);
aSourceCode.append( "Rem Attribute VBA_ModuleType=" );
switch( mnType )
{