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 /sdext | |
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 'sdext')
-rw-r--r-- | sdext/source/pdfimport/tree/drawtreevisiting.cxx | 2 | ||||
-rw-r--r-- | sdext/source/pdfimport/tree/style.cxx | 2 | ||||
-rw-r--r-- | sdext/source/pdfimport/tree/writertreevisiting.cxx | 2 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index 3f623a2cda09..b0d51c5cc2b8 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -718,7 +718,7 @@ void DrawXmlOptimizer::optimizeTextElements(Element& rParent) { pCur->updateGeometryWith( pNext ); // append text to current element - pCur->Text.append( pNext->Text.getStr(), pNext->Text.getLength() ); + pCur->Text.append( pNext->Text ); str = pCur->Text.getStr(); for(int i=0; i< str.getLength(); i++) diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index 67e188c4b0ce..a4314fe61ab9 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -167,7 +167,7 @@ OUString StyleContainer::getStyleName( sal_Int32 nStyle ) const else aStyleName = OStringToOUString( rStyle.Name, RTL_TEXTENCODING_ASCII_US ); sal_Int32 nIndex = aStyleName.lastIndexOf( ':' ); - aRet.append( aStyleName.copy( nIndex+1 ) ); + aRet.appendCopy( aStyleName, nIndex+1 ); aRet.append( nStyle ); } } diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx index f6f6c492f240..b9e01fe5c393 100644 --- a/sdext/source/pdfimport/tree/writertreevisiting.cxx +++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx @@ -811,7 +811,7 @@ void WriterXmlOptimizer::optimizeTextElements(Element& rParent) { pCur->updateGeometryWith( pNext ); // append text to current element - pCur->Text.append( pNext->Text.getStr(), pNext->Text.getLength() ); + pCur->Text.append( pNext->Text ); // append eventual children to current element // and clear children (else the children just // appended to pCur would be destroyed) diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index a7771ea220ac..6b348dd40b76 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -382,13 +382,13 @@ void PresenterController::UpdatePaneTitles() if (nStartIndex < 0) { // Add the remaining part of the string. - sResult.append(sTemplate.copy(nIndex)); + sResult.appendCopy(sTemplate, nIndex); break; } else { // Add the part preceding the next %. - sResult.append(sTemplate.copy(nIndex, nStartIndex-nIndex)); + sResult.appendCopy(sTemplate, nIndex, nStartIndex-nIndex); // Get the placeholder ++nStartIndex; |