diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-07 10:34:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-14 08:35:00 +0200 |
commit | cd66852f6dd08631a25d15a1527a647e69ab8ce3 (patch) | |
tree | 0ac1fab1d063046376e31e21d6656ee05eebb627 /oox/source/dump | |
parent | 095e1ca4372d90da7fc56051f1271ddd975a9e3a (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/source/dump')
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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 |