summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-07 10:34:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-14 08:35:00 +0200
commitcd66852f6dd08631a25d15a1527a647e69ab8ce3 (patch)
tree0ac1fab1d063046376e31e21d6656ee05eebb627 /oox
parent095e1ca4372d90da7fc56051f1271ddd975a9e3a (diff)
create appendCopy method in OUStringBuffer
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/relationshandler.cxx2
-rw-r--r--oox/source/dump/dumperbase.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx
index 7308f41ec9ad..16eb928ded2a 100644
--- a/oox/source/core/relationshandler.cxx
+++ b/oox/source/core/relationshandler.cxx
@@ -44,7 +44,7 @@ OUString lclGetRelationsPath( const OUString& rFragmentPath )
return
OUStringBuffer( rFragmentPath.copy( 0, nPathLen ) ). // file path including slash
append( "_rels/" ). // additional '_rels/' path
- append( rFragmentPath.copy( nPathLen ) ). // file name after path
+ appendCopy( rFragmentPath, nPathLen ). // file name after path
append( ".rels" ). // '.rels' suffix
makeStringAndClear();
}
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index b38e5f54fbe9..2d8fb299c010 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -496,7 +496,7 @@ void StringHelper::appendEncString( OUStringBuffer& rStr, const OUString& rData,
if( (nBeg == 0) && (nIdx == nEnd) )
rStr.append( rData );
else
- rStr.append( rData.copy( nBeg, nIdx - nBeg ) );
+ rStr.appendCopy( rData, nBeg, nIdx - nBeg );
}
// append characters to be encoded
while( (nIdx < nEnd) && (rData[ nIdx ] < 0x20) )
@@ -562,7 +562,7 @@ OUString lclTrimQuotedStringList( const OUString& rStr )
{
// seek to next quote character and add text portion to token buffer
sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_QUOTE, nPos );
- aToken.append( rStr.copy( nPos, nEnd - nPos ) );
+ aToken.appendCopy( rStr, nPos, nEnd - nPos );
// process literal quotes
while( (nEnd + 1 < nLen) && (rStr[ nEnd ] == OOX_DUMP_CFG_QUOTE) && (rStr[ nEnd + 1 ] == OOX_DUMP_CFG_QUOTE) )
{
@@ -585,7 +585,7 @@ OUString lclTrimQuotedStringList( const OUString& rStr )
{
// find list separator, add token text to buffer
sal_Int32 nEnd = lclIndexOf( rStr, OOX_DUMP_CFG_LISTSEP, nPos );
- aBuffer.append( rStr.copy( nPos, nEnd - nPos ) );
+ aBuffer.appendCopy( rStr, nPos, nEnd - nPos );
if( nEnd < nLen )
aBuffer.append( OOX_DUMP_LF );
// set current position behind list separator