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 /xmloff | |
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 'xmloff')
-rw-r--r-- | xmloff/source/core/xmluconv.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/meta/xmlmetai.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/fonthdl.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmlexppr.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index affb5843f193..76f9467b9fe4 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -422,7 +422,7 @@ void SvXMLUnitConverter::convertDateTime( OUStringBuffer& rBuffer, if ( a100th.getLength() > 2 ) { rBuffer.append( '.'); - rBuffer.append( a100th.copy( 2 ) ); // strip 0. + rBuffer.appendCopy( a100th, 2 ); // strip 0. } } } diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 3e459c661f7c..3f82594627cc 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -236,8 +236,8 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno: if ( nBegin != -1 ) { sBuffer.append( '$' ); - sBuffer.append( i_rBuildId.copy( - nBegin + sBuildCompare.getLength() ) ); + sBuffer.appendCopy( i_rBuildId, + nBegin + sBuildCompare.getLength() ); sBuildId = sBuffer.makeStringAndClear(); } } diff --git a/xmloff/source/style/fonthdl.cxx b/xmloff/source/style/fonthdl.cxx index 0a2d0d9b8514..60da2fca83e1 100644 --- a/xmloff/source/style/fonthdl.cxx +++ b/xmloff/source/style/fonthdl.cxx @@ -93,7 +93,7 @@ bool XMLFontFamilyNamePropHdl::importXML( const OUString& rStrImpValue, uno::Any if( !sValue.isEmpty() ) sValue.append(';'); - sValue.append(rStrImpValue.copy( nFirst, nLast-nFirst+1)); + sValue.appendCopy(rStrImpValue, nFirst, nLast-nFirst+1); } if( -1 != nPos ) diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index dc6f9171a137..80dd7e979dc9 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -937,7 +937,7 @@ void SvXMLExportPropertyMapper::_exportXML( sPrefix = pNamespaceMap->GetPrefixByKey( nKey ); } // In any case, the attribute name has to be adapted. - sNameBuffer.append( sPrefix + ":" + pAttribName->copy( nColonPos+1 ) ); + sNameBuffer.append(sPrefix).append(":").appendCopy(*pAttribName, nColonPos+1 ); sAttribName = sNameBuffer.makeStringAndClear(); } |