[Libreoffice-commits] core.git: basic/source comphelper/source configmgr/qa connectivity/source desktop/source editeng/source forms/source framework/source i18npool/source include/rtl oox/source opencl/source registry/source sax/source sc/source sdext/source stoc/source svl/source sw/source toolkit/source ucb/source unotools/source vbahelper/source vcl/source writerfilter/source xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 14 06:35:23 UTC 2018


 basic/source/comp/codegen.cxx                                     |    2 
 basic/source/runtime/runtime.cxx                                  |    2 
 comphelper/source/misc/string.cxx                                 |    2 
 configmgr/qa/unit/test.cxx                                        |    2 
 connectivity/source/commontools/dbtools2.cxx                      |    4 
 connectivity/source/drivers/firebird/Clob.cxx                     |    4 
 connectivity/source/drivers/firebird/PreparedStatement.cxx        |    4 
 desktop/source/app/updater.cxx                                    |    2 
 desktop/source/deployment/misc/dp_misc.cxx                        |    2 
 desktop/source/deployment/misc/dp_ucb.cxx                         |   12 +-
 editeng/source/editeng/editdoc.cxx                                |    2 
 editeng/source/misc/svxacorr.cxx                                  |    5 -
 forms/source/component/Filter.cxx                                 |    2 
 framework/source/uielement/toolbarsmenucontroller.cxx             |    4 
 i18npool/source/characterclassification/cclass_unicode_parser.cxx |   12 +-
 i18npool/source/nativenumber/nativenumbersupplier.cxx             |    4 
 include/rtl/ustrbuf.hxx                                           |   41 ++++++++++
 oox/source/core/relationshandler.cxx                              |    2 
 oox/source/dump/dumperbase.cxx                                    |    6 -
 opencl/source/openclconfig.cxx                                    |    4 
 registry/source/keyimpl.cxx                                       |    2 
 sax/source/tools/converter.cxx                                    |    2 
 sc/source/core/tool/address.cxx                                   |    2 
 sc/source/filter/excel/xehelper.cxx                               |    2 
 sc/source/ui/app/inputhdl.cxx                                     |    4 
 sdext/source/pdfimport/tree/drawtreevisiting.cxx                  |    2 
 sdext/source/pdfimport/tree/style.cxx                             |    2 
 sdext/source/pdfimport/tree/writertreevisiting.cxx                |    2 
 sdext/source/presenter/PresenterController.cxx                    |    4 
 stoc/source/uriproc/ExternalUriReferenceTranslator.cxx            |    4 
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |    6 -
 svl/source/misc/urihelper.cxx                                     |    5 -
 svl/source/numbers/zformat.cxx                                    |   10 +-
 sw/source/core/access/accportions.cxx                             |    2 
 sw/source/core/bastyp/calc.cxx                                    |    8 -
 sw/source/core/crsr/pam.cxx                                       |    2 
 sw/source/core/fields/cellfml.cxx                                 |    4 
 sw/source/core/text/redlnitr.cxx                                  |    4 
 sw/source/filter/xml/xmltexte.cxx                                 |    2 
 toolkit/source/awt/animatedimagespeer.cxx                         |    4 
 ucb/source/ucp/tdoc/tdoc_content.cxx                              |    2 
 unotools/source/config/configpaths.cxx                            |    4 
 unotools/source/i18n/textsearch.cxx                               |    4 
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx                |    4 
 vcl/source/control/field.cxx                                      |   14 +--
 vcl/source/control/field2.cxx                                     |    2 
 vcl/source/control/longcurr.cxx                                   |    2 
 vcl/source/edit/texteng.cxx                                       |    4 
 vcl/source/window/menu.cxx                                        |    4 
 vcl/source/window/printdlg.cxx                                    |    4 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx                    |    2 
 xmloff/source/core/xmluconv.cxx                                   |    2 
 xmloff/source/meta/xmlmetai.cxx                                   |    4 
 xmloff/source/style/fonthdl.cxx                                   |    2 
 xmloff/source/style/xmlexppr.cxx                                  |    2 
 55 files changed, 144 insertions(+), 103 deletions(-)

New commits:
commit cd66852f6dd08631a25d15a1527a647e69ab8ce3
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Aug 7 10:34:54 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 14 08:35:00 2018 +0200

    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 at collabora.co.uk>

diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index fc234dfa1579..7cc715f7fa8e 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -212,7 +212,7 @@ void SbiCodeGen::Save()
                         {
                             aIfaceProcName.append(aPropPrefix);
                         }
-                        aIfaceProcName.append(aPureProcName.copy( rIfaceName.getLength() + 1 ));
+                        aIfaceProcName.appendCopy(aPureProcName, rIfaceName.getLength() + 1 );
                         aIfaceName = rIfaceName;
                         nPassCount = 2;
                         break;
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 9e4e632ba455..04f597846b7c 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -2051,7 +2051,7 @@ void SbiRuntime::StepRSET()
         }
         else
         {
-            aNewStr.append(aRefValString.copy(0, nVarStrLen));
+            aNewStr.appendCopy(aRefValString, 0, nVarStrLen);
         }
         refVar->PutString(aNewStr.makeStringAndClear());
 
diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx
index b72c6da3eea2..89d72a3a1cf2 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -443,7 +443,7 @@ OUString removeAny(OUString const& rIn,
             {
                 if (i > 0)
                 {
-                    buf.append(rIn.copy(0, i));
+                    buf.appendCopy(rIn, 0, i);
                 }
                 isFound = true;
             }
diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx
index 2c8138abe19e..1ea04c4081f1 100644
--- a/configmgr/qa/unit/test.cxx
+++ b/configmgr/qa/unit/test.cxx
@@ -553,7 +553,7 @@ void normalize(
     } else {
         OUStringBuffer buf(path);
         buf.append('/');
-        buf.append(relative.copy(0, i));
+        buf.appendCopy(relative, 0, i);
         *normalizedPath = buf.makeStringAndClear();
         *name = relative.copy(i + 1);
     }
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index cd09553e06df..5e1296adbbc6 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -132,7 +132,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const
         }
         else
         {
-            aSql.append(sTypeName.copy(0,++nParenPos));
+            aSql.appendCopy(sTypeName, 0, ++nParenPos);
         }
 
         if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP )
@@ -149,7 +149,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const
         else
         {
             nParenPos = sTypeName.indexOf(')',nParenPos);
-            aSql.append(sTypeName.copy(nParenPos));
+            aSql.appendCopy(sTypeName, nParenPos);
         }
     }
     else
diff --git a/connectivity/source/drivers/firebird/Clob.cxx b/connectivity/source/drivers/firebird/Clob.cxx
index d14e35723569..2d150da912f1 100644
--- a/connectivity/source/drivers/firebird/Clob.cxx
+++ b/connectivity/source/drivers/firebird/Clob.cxx
@@ -99,7 +99,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition,
             if( nCharsToCopy > nLength )
                 nCharsToCopy = nLength;
             // append relevant part of first segment
-            sSegmentBuffer.append( sSegment.copy(0, nCharsToCopy ) );
+            sSegmentBuffer.appendCopy( sSegment, 0, nCharsToCopy );
             nActLen += sSegmentBuffer.getLength();
         }
     }
@@ -115,7 +115,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition,
                             RTL_TEXTENCODING_UTF8 );
         sal_Int32 nStrLen = sSegment.getLength();
         if( nActLen + nStrLen > nLength )
-            sSegmentBuffer.append(sSegment.copy(0, nLength - nActLen) );
+            sSegmentBuffer.appendCopy(sSegment, 0, nLength - nActLen);
         else
             sSegmentBuffer.append(sSegment);
         nActLen += nStrLen;
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index e55266780242..acb99c8abb99 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -333,9 +333,9 @@ sal_Int64 toNumericWithoutDecimalPlace(const OUString& sSource)
         OUStringBuffer sBuffer(15);
         if(nDotIndex > 0)
         {
-            sBuffer.append(sNumber.copy(0, nDotIndex));
+            sBuffer.appendCopy(sNumber, 0, nDotIndex);
         }
-        sBuffer.append(sNumber.copy(nDotIndex + 1));
+        sBuffer.appendCopy(sNumber, nDotIndex + 1);
         return sBuffer.makeStringAndClear().toInt64();
     }
 }
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index adcc130751e7..ca62f4a8ae39 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -571,7 +571,7 @@ std::string download_content(const OString& rURL, bool bFile, OUString& rHash)
     {
         OUString aTempFileURL = aTempFile.GetURL();
         OString aTempFileURLOString = OUStringToOString(aTempFileURL, RTL_TEXTENCODING_UTF8);
-        response_body.append(aTempFileURLOString.getStr(), aTempFileURLOString.getLength());
+        response_body.append(aTempFileURLOString);
 
         aTempFile.EnableKillingFile(false);
 
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 9ab6d8f09743..b231dac760ec 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -266,7 +266,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
 {
     OUStringBuffer buf;
     if (baseURL.getLength() > 1 && baseURL[ baseURL.getLength() - 1 ] == '/')
-        buf.append( baseURL.copy( 0, baseURL.getLength() - 1 ) );
+        buf.appendCopy( baseURL, 0, baseURL.getLength() - 1 );
     else
         buf.append( baseURL );
     OUString relPath(relPath_);
diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx
index be62722ffc43..10e696a0a745 100644
--- a/desktop/source/deployment/misc/dp_ucb.cxx
+++ b/desktop/source/deployment/misc/dp_ucb.cxx
@@ -215,18 +215,18 @@ bool readLine( OUString * res, OUString const & startingWith,
             {
                 pos = file.indexOf( LF, pos );
                 if (pos < 0) { // EOF
-                    buf.append( file.copy( start ) );
+                    buf.appendCopy( file, start );
                 }
                 else
                 {
                     if (pos > 0 && file[ pos - 1 ] == CR)
                     {
                         // consume extra CR
-                        buf.append( file.copy( start, pos - start - 1 ) );
+                        buf.appendCopy( file, start, pos - start - 1 );
                         ++pos;
                     }
                     else
-                        buf.append( file.copy( start, pos - start ) );
+                        buf.appendCopy( file, start, pos - start );
                     ++pos; // consume LF
                     // check next line:
                     if (pos < file.getLength() &&
@@ -270,16 +270,16 @@ bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
         bool bEOF = false;
         pos = file.indexOf( LF, pos );
         if (pos < 0) { // EOF
-            buf.append( file.copy( start ) );
+            buf.appendCopy( file, start );
             bEOF = true;
         }
         else
         {
             if (pos > 0 && file[ pos - 1 ] == CR)
                 // consume extra CR
-                buf.append( file.copy( start, pos - start - 1 ) );
+                buf.appendCopy( file, start, pos - start - 1 );
             else
-                buf.append( file.copy( start, pos - start ) );
+                buf.appendCopy( file, start, pos - start );
             pos++;
         }
         OUString aLine = buf.makeStringAndClear();
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 373ee7b5158a..76fd0a4d6f01 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1647,7 +1647,7 @@ OUString ContentNode::GetExpandedText(sal_Int32 nStartPos, sal_Int32 nEndPos) co
         DBG_ASSERT( nEnd >= nIndex, "End in front of the index?" );
         //!! beware of sub string length  of -1
         if (nEnd > nIndex)
-            aStr.append( GetString().copy(nIndex, nEnd - nIndex) );
+            aStr.appendCopy( GetString(), nIndex, nEnd - nIndex );
 
         if ( pNextFeature )
         {
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 2166d323a082..3029101da61d 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2805,11 +2805,12 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
                                 nTmp++;
                             if (nTmp < nSttWdPos)
                                 break; // word delimiter found
-                            buf.append(rTxt.copy(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong());
+                            buf.appendCopy(rTxt, nFndPos, nSttWdPos - nFndPos).append(pFnd->GetLong());
                             nFndPos = nSttWdPos + sTmp.getLength();
                         }
                     } while (nSttWdPos != -1);
-                    if (nEndPos - nFndPos > extra_repl) buf.append(rTxt.copy(nFndPos, nEndPos - nFndPos));
+                    if (nEndPos - nFndPos > extra_repl)
+                        buf.appendCopy(rTxt, nFndPos, nEndPos - nFndPos);
                     aLong = buf.makeStringAndClear();
                 }
                 SvxAutocorrWord* pNew = new SvxAutocorrWord(aShort, aLong);
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index 46b5fa307cd5..9b956a19b6d1 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -306,7 +306,7 @@ namespace frm
                     // To fix this, we would probably have to revert here to always return "1" or "0" as normalized
                     // filter, and change our client code to properly translate this (which could be some effort).
                     if ( nMarkerPos == 0 )
-                        aText.append( sText.copy( sExpressionMarker.getLength() ) );
+                        aText.appendCopy( sText, sExpressionMarker.getLength() );
                     else
                     {
                         // fallback
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index 71b6e42b25d2..fc22ed4cc279 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -392,7 +392,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > co
 
             sal_Int32 n = aSortedTbs[i].aCommand.lastIndexOf( '/' );
             if (( n > 0 ) && (( n+1 ) < aSortedTbs[i].aCommand.getLength() ))
-                aStrBuf.append( aSortedTbs[i].aCommand.copy( n+1 ));
+                aStrBuf.appendCopy( aSortedTbs[i].aCommand, n+1 );
 
             OUString aCmd( aStrBuf.makeStringAndClear() );
 
@@ -664,7 +664,7 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& r
                     if (( nIndex > 0 ) && (( nIndex+1 ) < aCmd.getLength() ))
                     {
                         OUStringBuffer aBuf( "private:resource/toolbar/" );
-                        aBuf.append( aCmd.copy( nIndex+1 ));
+                        aBuf.appendCopy( aCmd, nIndex+1 );
 
                         bool      bShow( !pVCLPopupMenu->IsItemChecked( rEvent.MenuId ));
                         OUString aToolBarResName( aBuf.makeStringAndClear() );
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
index cdf9821776c2..8192d7ddab16 100644
--- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx
@@ -880,13 +880,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
                     {
                         if ( cLast == '\\' )
                         {   // escaped
-                            aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 2);
+                            aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 2);
                             aSymbol.append(OUString(&current, 1));
                         }
                         else
                         {
                             eState = ssStop;
-                            aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
+                            aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
                         }
                         postSymbolIndex = nextCharIndex;
                     }
@@ -905,13 +905,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
                 {
                     if ( cLast == '\\' )
                     {   // escaped
-                        aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 2);
+                        aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 2);
                         aSymbol.append(OUString(&current, 1));
                     }
                     else if (current == nextChar &&
                             !(nContTypes & KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING) )
                     {   // "" => literal " escaped
-                        aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex);
+                        aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex);
                         nextCharIndex = index;
                         if (index < rText.getLength()) { ++nCodePoints; }
                         nextChar = (index < rText.getLength()) ? rText.iterateCodePoints(&index) : 0;
@@ -919,7 +919,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
                     else
                     {
                         eState = ssStop;
-                        aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
+                        aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
                     }
                     postSymbolIndex = nextCharIndex;
                 }
@@ -1028,7 +1028,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
     {
         if (postSymbolIndex < nextCharIndex)
         {   //! open quote
-            aSymbol.append(rText.getStr() + postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
+            aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
             r.TokenType |= KParseType::MISSING_QUOTE;
         }
         r.DequotedNameOrString = aSymbol.toString();
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 869ff60df4aa..5272954ecaad 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -1072,7 +1072,7 @@ OUString getHebrewNativeNumberString(const OUString& aNumberString, bool useGere
         makeHebrewNumber(value, output, true, useGeresh);
 
         if (i < len)
-            output.append(aNumberString.copy(i));
+            output.appendCopy(aNumberString,i);
 
         return output.makeStringAndClear();
     }
@@ -1191,7 +1191,7 @@ OUString getCyrillicNativeNumberString(const OUString& aNumberString)
         makeCyrillicNumber(value, output, true);
 
         if (i < len)
-            output.append(aNumberString.copy(i));
+            output.appendCopy(aNumberString,i);
 
         return output.makeStringAndClear();
     }
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 6958093e71c8..e504cb894755 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -530,6 +530,47 @@ public:
         return append( str.getStr(), str.getLength() );
     }
 
+#ifdef LIBO_INTERNAL_ONLY
+    /**
+        Appends a substring of an OUString, starting at position beginIndex.
+
+        The characters of the <code>OUString</code> argument are appended, in
+        order, to the contents of this string buffer.
+
+        @param   str   a string.
+        @param   beginIndex the beginning index, inclusive. Must be >= 0 and <= the length of str.
+        @return  this string buffer.
+
+        @since LibreOffice 6.2
+     */
+    OUStringBuffer & appendCopy(const OUString &str, sal_Int32 beginIndex)
+    {
+        assert(beginIndex >=0 && beginIndex <= str.getLength());
+        return append( str.getStr() + beginIndex, str.getLength() - beginIndex );
+    }
+
+    /**
+        Appends a substring of an OUString, starting at position beginIndex,
+        running for count characters.
+
+        The characters of the <code>OUString</code> argument are appended, in
+        order, to the contents of this string buffer.
+
+        @param   str    a string.
+        @param   beginIndex the beginning index, inclusive. Must be >= 0 and <= the length of str.
+        @param   count must be >= 0 and <= (str.length() - beginIndex).
+        @return  this string buffer.
+
+        @since LibreOffice 6.2
+     */
+    OUStringBuffer & appendCopy(const OUString &str, sal_Int32 beginIndex, sal_Int32 count)
+    {
+        assert(beginIndex >=0 && beginIndex <= str.getLength());
+        assert(count >=0 && count <= (str.getLength() - beginIndex));
+        return append( str.getStr() + beginIndex, count );
+    }
+#endif // LIBO_INTERNAL_ONLY
+
     /**
         Appends the content of a stringbuffer to this string buffer.
 
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
diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx
index 18a9f865be00..7517cf3fecdf 100644
--- a/opencl/source/openclconfig.cxx
+++ b/opencl/source/openclconfig.cxx
@@ -76,7 +76,7 @@ OUString getToken(const OUString& string, sal_Int32& index)
     while ((p = token.indexOf('%', i)) >= 0)
     {
         if (p > i)
-            result.append(token.copy(i, p - i));
+            result.appendCopy(token, i, p - i);
         if (p < token.getLength() - 2)
         {
             result.append(OUStringLiteral1(token.copy(p+1, 2).toInt32(16)));
@@ -87,7 +87,7 @@ OUString getToken(const OUString& string, sal_Int32& index)
             i = token.getLength();
         }
     }
-    result.append(token.copy(i));
+    result.appendCopy(token,i);
 
     return result.makeStringAndClear();
 }
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index 1a511a5e2a44..82077d4f287c 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -1036,7 +1036,7 @@ OUString ORegKey::getFullPath(OUString const & path) const {
     OUStringBuffer b(m_name);
     if (!b.isEmpty() && b[b.getLength() - 1] == '/') {
         if (path[0] == '/') {
-            b.append(path.copy(1));
+            b.appendCopy(path,1);
         } else {
             b.append(path);
         }
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index e8bd90f02c21..416ada3f4ce4 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -754,7 +754,7 @@ void Converter::convertDuration(OUStringBuffer& rBuffer,
         if ( aNS.getLength() > 2 )
         {
             rBuffer.append( '.');
-            rBuffer.append( aNS.copy( 2 ) );     // strip "0."
+            rBuffer.appendCopy( aNS, 2 );     // strip "0."
         }
     }
     rBuffer.append( 'S');
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 35e1dbe69a7d..036ba8376a8d 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -2154,7 +2154,7 @@ static void lcl_ScRange_Format_XL_Header( OUStringBuffer& rString, const ScRange
                 {
                     if (!aDocName.isEmpty())
                     {
-                        rString.append("'[").append(aDocName).append("]").append(aTabName.copy(1));
+                        rString.append("'[").append(aDocName).append("]").appendCopy(aTabName, 1);
                     }
                     else
                     {
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index ecc10f076f6a..c2b825814b78 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -921,7 +921,7 @@ OUString lclEncodeDosUrl(
                 // Excel seems confused by this token).
                 aBuf.append(EXC_URL_PARENTDIR);
             else
-                aBuf.append(aOldUrl.copy(0,nPos)).append(EXC_URL_SUBDIR);
+                aBuf.appendCopy(aOldUrl,0,nPos).append(EXC_URL_SUBDIR);
 
             aOldUrl = aOldUrl.copy(nPos + 1);
         }
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 2a544ab4151b..4c1f3a51e9d6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -985,9 +985,9 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
                             if (nStartPosition > 0)
                             {
                                 OUStringBuffer aBuf;
-                                aBuf.append(aNew.copy(0, nStartPosition));
+                                aBuf.appendCopy(aNew, 0, nStartPosition);
                                 aBuf.append(u'\x25BA');
-                                aBuf.append(aNew.copy(nStartPosition));
+                                aBuf.appendCopy(aNew, nStartPosition);
                                 nArgs = ppFDesc->getParameterCount();
                                 sal_Int16 nVarArgsSet = 0;
                                 if ( nArgs >= PAIRED_VAR_ARGS )
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;
diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
index 333a28aad663..f1f102311c7e 100644
--- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
+++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
@@ -91,7 +91,7 @@ OUString Translator::translateToInternal(
     }
     sal_Int32 i = RTL_CONSTASCII_LENGTH("file:");
     OUStringBuffer buf;
-    buf.append(externalUriReference.getStr(), i);
+    buf.appendCopy(externalUriReference, 0, i);
     // Some environments (e.g., Java) produce illegal file URLs without an
     // authority part; treat them as having an empty authority part:
     if (!externalUriReference.match("//", i))
@@ -139,7 +139,7 @@ OUString Translator::translateToExternal(
     }
     sal_Int32 i = RTL_CONSTASCII_LENGTH("file://");
     OUStringBuffer buf;
-    buf.append(internalUriReference.getStr(), i);
+    buf.appendCopy(internalUriReference, 0, i);
     rtl_TextEncoding encoding = osl_getThreadTextEncoding();
     for (bool path = true;;) {
         sal_Int32 j = i;
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index 5280e54164be..af7b25c57264 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -284,7 +284,7 @@ void SAL_CALL UrlReference::setName(OUString const & name)
 
     OUStringBuffer newPath;
     newPath.append(encodeNameOrParamFragment(name));
-    newPath.append(m_base.m_path.copy(i));
+    newPath.appendCopy(m_base.m_path, i);
     m_base.m_path = newPath.makeStringAndClear();
 }
 
@@ -315,7 +315,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value)
     }
 
     OUStringBuffer newPath;
-    newPath.append(m_base.m_path.copy(0, i));
+    newPath.appendCopy(m_base.m_path, 0, i);
     if (!bExistent) {
         newPath.append( m_base.m_path.indexOf('?') < 0 ? '?' : '&' );
         newPath.append(encodeNameOrParamFragment(key));
@@ -325,7 +325,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value)
     if (bExistent) {
         /*oldValue = */
         parsePart(m_base.m_path, false, &i); // skip key
-        newPath.append(m_base.m_path.copy(i));
+        newPath.appendCopy(m_base.m_path, i);
     }
 
     m_base.m_path = newPath.makeStringAndClear();
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index f757b2524947..290d81cca769 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -783,12 +783,11 @@ OUString URIHelper::resolveIdnaHost(OUString const & url) {
         return url;
     }
     OUStringBuffer buf(uri->getScheme());
-    buf.append("://").append(auth.getStr(), hostStart);
+    buf.append("://").appendCopy(auth, 0, hostStart);
     buf.append(
         reinterpret_cast<sal_Unicode const *>(ascii.getBuffer()),
         ascii.length());
-    buf.append(auth.getStr() + hostEnd, auth.getLength() - hostEnd)
-        .append(uri->getPath());
+    buf.appendCopy(auth, hostEnd).append(uri->getPath());
     if (uri->hasQuery()) {
         buf.append('?').append(uri->getQuery());
     }
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index f9e0b944b615..38b8f243f22d 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1706,7 +1706,7 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString,
                         0 <= nNatNumNum && nNatNumNum <= 19 )
                 {
                     sBuffSymbol.stripStart('[');
-                    sBuffSymbol.append( aBufStr.copy( --nPos, aNatNum.getLength()+1 ));
+                    sBuffSymbol.appendCopy( aBufStr, --nPos, aNatNum.getLength()+1 );
                     nPos += aNatNum.getLength()+1;
                     //! SymbolType is negative
                     eSymbolType = static_cast<short>(BRACKET_SYMBOLTYPE_NATNUM0 - nNatNumNum);
@@ -1716,7 +1716,7 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString,
                         1 <= nDBNum && nDBNum <= 9 )
                 {
                     sBuffSymbol.stripStart('[');
-                    sBuffSymbol.append( aBufStr.copy( --nPos, aDBNum.getLength()+1 ));
+                    sBuffSymbol.appendCopy( aBufStr, --nPos, aDBNum.getLength()+1 );
                     nPos += aDBNum.getLength()+1;
                     //! SymbolType is negative
                     eSymbolType = sal::static_int_cast< short >( BRACKET_SYMBOLTYPE_DBNUM1 - (nDBNum - 1) );
@@ -1944,7 +1944,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr )
         }
         else
         {
-            aTmp.append(rStr.copy( nStartPos, nPos - nStartPos ));
+            aTmp.appendCopy(rStr, nStartPos, nPos - nStartPos );
             nStartPos = nPos + 2;
             sal_Int32 nDash;
             nEnd = nStartPos - 1;
@@ -1975,13 +1975,13 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr )
             {
                 nPos = nDash;
             }
-            aTmp.append(rStr.copy( nStartPos, nPos - nStartPos ));
+            aTmp.appendCopy(rStr, nStartPos, nPos - nStartPos );
             nStartPos = nClose + 1;
         }
     }
     if ( nLen > nStartPos )
     {
-        aTmp.append(rStr.copy( nStartPos, nLen - nStartPos ));
+        aTmp.appendCopy(rStr, nStartPos, nLen - nStartPos );
     }
     return aTmp.makeStringAndClear();
 }
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 55f548845af9..667ec0dabf1d 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -117,7 +117,7 @@ void SwAccessiblePortionData::Text(TextFrameIndex const nLength,
     m_aPortionAttrs.push_back( nAttr );
 
     // update buffer + nModelPosition
-    m_aBuffer.append( m_pTextNode->GetText().copy(m_nModelPosition, nLength) );
+    m_aBuffer.appendCopy( m_pTextNode->GetText(), m_nModelPosition, nLength );
     m_nModelPosition += nLength;
 }
 
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index ed59425aa964..93bb22a3f31a 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -758,8 +758,8 @@ SwCalcOper SwCalc::GetToken()
                                 // ignore the ]
                                 if ('\\' == m_sCommand[nFndPos-1])
                                 {
-                                    m_aVarName.append(m_sCommand.copy( nSttPos,
-                                                    nFndPos - nSttPos - 1 ));
+                                    m_aVarName.appendCopy(m_sCommand, nSttPos,
+                                                    nFndPos - nSttPos - 1 );
                                     nSttPos = ++nFndPos;
                                 }
                                 else
@@ -770,8 +770,8 @@ SwCalcOper SwCalc::GetToken()
                         if( nFndPos != -1 )
                         {
                             if( nSttPos != nFndPos )
-                                m_aVarName.append(m_sCommand.copy( nSttPos,
-                                                    nFndPos - nSttPos ));
+                                m_aVarName.appendCopy(m_sCommand, nSttPos,
+                                                    nFndPos - nSttPos );
                             aRes.EndPos = nFndPos + 1;
                             m_eCurrOper = CALC_NAME;
                         }
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index a2684095b51a..469e0e41b5db 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1000,7 +1000,7 @@ OUString SwPaM::GetText() const
                     ? End()->nContent.GetIndex()
                     : aTmpStr.getLength();
 
-                aResult.append(aTmpStr.getStr() + nStart, nEnd-nStart);
+                aResult.appendCopy(aTmpStr, nStart, nEnd-nStart);
             }
             else
             {
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index a67cf9c2b397..8afa4f28d2ac 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -635,12 +635,12 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTa
         if (nStt<0 || nEnd<0 )
         {
             // set the rest and finish
-            aStr.append(m_sFormula.copy(nFormula));
+            aStr.appendCopy(m_sFormula, nFormula);
             break;
         }
 
         // write beginning
-        aStr.append(m_sFormula.copy(nFormula, nStt - nFormula));
+        aStr.appendCopy(m_sFormula, nFormula, nStt - nFormula);
 
         if (fnFormula)
         {
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 0d2a39f5fdad..f95682e18d6b 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -79,7 +79,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode)
         if (pStart->nContent != nLastEnd) // not 0 so we eliminate adjacent deletes
         {
             extents.emplace_back(pNode, nLastEnd, pStart->nContent.GetIndex());
-            mergedText.append(pNode->GetText().copy(nLastEnd, pStart->nContent.GetIndex() - nLastEnd));
+            mergedText.appendCopy(pNode->GetText(), nLastEnd, pStart->nContent.GetIndex() - nLastEnd);
         }
         if (&pEnd->nNode.GetNode() != pNode)
         {
@@ -105,7 +105,7 @@ CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode)
     if (nLastEnd != pNode->Len())
     {
         extents.emplace_back(pNode, nLastEnd, pNode->Len());
-        mergedText.append(pNode->GetText().copy(nLastEnd, pNode->Len() - nLastEnd));
+        mergedText.appendCopy(pNode->GetText(), nLastEnd, pNode->Len() - nLastEnd);
     }
     if (extents.empty()) // there was no text anywhere
     {
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index 7ca7c63922cc..5775a3343257 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -366,7 +366,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
                         if( aBuffer.isEmpty() )
                         {
                             aBuffer.append( '\'' );
-                            aBuffer.append( sRange.copy( 0, i ) );
+                            aBuffer.appendCopy( sRange, 0, i );
                         }
                         if( '\'' == c || '\\' == c )
                             aBuffer.append( '\\' );
diff --git a/toolkit/source/awt/animatedimagespeer.cxx b/toolkit/source/awt/animatedimagespeer.cxx
index 58e9f6c09a1a..a0fa5cc71567 100644
--- a/toolkit/source/awt/animatedimagespeer.cxx
+++ b/toolkit/source/awt/animatedimagespeer.cxx
@@ -117,9 +117,9 @@ namespace toolkit
             ENSURE_OR_RETURN( separatorPos != -1, "lcl_getHighContrastURL: unsupported URL scheme - cannot automatically determine HC version!", i_imageURL );
 
             OUStringBuffer composer;
-            composer.append( i_imageURL.copy( 0, separatorPos ) );
+            composer.appendCopy( i_imageURL, 0, separatorPos );
             composer.append( "/sifr" );
-            composer.append( i_imageURL.copy( separatorPos ) );
+            composer.appendCopy( i_imageURL, separatorPos );
             return composer.makeStringAndClear();
         }
 
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx
index 1d16c4c323cd..dc7316cba376 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -1740,7 +1740,7 @@ Content::queryChildContent( const OUString & rRelativeChildUri )
     if ( !rRelativeChildUri.startsWith("/") )
         aBuf.append( rRelativeChildUri );
     else
-        aBuf.append( rRelativeChildUri.copy( 1 ) );
+        aBuf.appendCopy( rRelativeChildUri, 1 );
 
     uno::Reference< ucb::XContentIdentifier > xChildId
         = new ::ucbhelper::ContentIdentifier( aBuf.makeStringAndClear() );
diff --git a/unotools/source/config/configpaths.cxx b/unotools/source/config/configpaths.cxx
index abbf8f465f09..cd2e9c7f06a7 100644
--- a/unotools/source/config/configpaths.cxx
+++ b/unotools/source/config/configpaths.cxx
@@ -49,7 +49,7 @@ void lcl_resolveCharEntities(OUString & aLocalString)
         OSL_ENSURE(ch,"Configuration path contains '&' that is not part of a valid character escape");
         if (ch)
         {
-            aResult.append(aLocalString.copy(nStart,nEscapePos-nStart)).append(ch);
+            aResult.appendCopy(aLocalString, nStart,nEscapePos-nStart).append(ch);
 
             sal_Int32 nEscapeEnd=aLocalString.indexOf(';',nEscapePos);
             nStart = nEscapeEnd+1;
@@ -62,7 +62,7 @@ void lcl_resolveCharEntities(OUString & aLocalString)
     }
     while ( nEscapePos > 0);
 
-    aResult.append(aLocalString.copy(nStart));
+    aResult.appendCopy(aLocalString, nStart);
 
     aLocalString = aResult.makeStringAndClear();
 }
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index baddd527d2b3..5bb4dfd81a4a 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -306,7 +306,7 @@ void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &r
             {
                 sal_Int32 nStart = rResult.startOffset[0];
                 sal_Int32 nLength = rResult.endOffset[0] - rResult.startOffset[0];
-                sBuff.append(rStr.getStr() + nStart, nLength);
+                sBuff.appendCopy(rStr, nStart, nLength);
             }
             else if((i < rReplaceStr.getLength() - 1) && rReplaceStr[i] == '$')
             {
@@ -339,7 +339,7 @@ void TextSearch::ReplaceBackReferences( OUString& rReplaceStr, const OUString &r
                                 nSttReg = rResult.endOffset[j];
                             }
                             // Copy reference from found string
-                            sBuff.append(rStr.getStr() + nSttReg, nRegLen);
+                            sBuff.appendCopy(rStr, nSttReg, nRegLen);
                         }
                         i += 1;
                     }
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 70c5705b5b72..058ddc2a4142 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -226,10 +226,10 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
         }
         else
         {
-            aBuffer.append( sLabel.copy( 0, index ) );
+            aBuffer.appendCopy( sLabel, 0, index );
             if( bMenu )
                 aBuffer.append( '&' );
-            aBuffer.append( sLabel.copy( index + 1 ) );
+            aBuffer.appendCopy( sLabel, index + 1 );
         }
         OUString sNewLabel = aBuffer.makeStringAndClear();
         SAL_INFO("vbahelper", "VbaCommandBarHelper::findControlByName, control name: " << sNewLabel);
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index c4ce25c48a5e..7bd182a9e975 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -112,23 +112,23 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue,
         // If in "a b/c" format.
         if(nFracNumPos != -1 )
         {
-            aStr1.append(aStr.getStr(), nFracNumPos);
-            aStrNum.append(aStr.getStr()+nFracNumPos+1, nFracDivPos-nFracNumPos-1);
-            aStrDenom.append(aStr.getStr()+nFracDivPos+1);
+            aStr1.appendCopy(aStr, 0, nFracNumPos);
+            aStrNum.appendCopy(aStr, nFracNumPos+1, nFracDivPos-nFracNumPos-1);
+            aStrDenom.appendCopy(aStr, nFracDivPos+1);
         }
         // "a/b" format, or not a fraction at all
         else
         {
-            aStrNum.append(aStr.getStr(), nFracDivPos);
-            aStrDenom.append(aStr.getStr()+nFracDivPos+1);
+            aStrNum.appendCopy(aStr, 0, nFracDivPos);
+            aStrDenom.appendCopy(aStr, nFracDivPos+1);
         }
 
     }
     // parse decimal strings
     else if ( nDecPos >= 0)
     {
-        aStr1.append(aStr.getStr(), nDecPos);
-        aStr2.append(aStr.getStr()+nDecPos+1);
+        aStr1.appendCopy(aStr, 0, nDecPos);
+        aStr2.appendCopy(aStr, nDecPos+1);
     }
     else
         aStr1 = aStr;
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index e093d15d2cb9..62f1b5bb8278 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -679,7 +679,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
             {
                 // possibly extend string until cursor position
                 if ( aStr.getLength() < nNewPos )
-                    aStr.append( rLiteralMask.copy( aStr.getLength(), nNewPos-aStr.getLength() ));
+                    aStr.appendCopy( rLiteralMask, aStr.getLength(), nNewPos-aStr.getLength() );
                 if ( nNewPos < aStr.getLength() )
                     aStr.insert( cChar, nNewPos );
                 else if ( nNewPos < rEditMask.getLength() )
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index f2a741abb6d6..3d46cf92d27c 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -117,7 +117,7 @@ bool ImplCurrencyGetValue( const OUString& rStr, BigInt& rValue,
     if ( nDecPos != -1 )
     {
         aStr1 = aStr.copy( 0, nDecPos );
-        aStr2.append(aStr.copy(nDecPos+1));
+        aStr2.appendCopy(aStr, nDecPos+1);
     }
     else
         aStr1 = aStr;
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 1f78eaea55cd..d3ebd1ae618c 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -274,7 +274,7 @@ OUString TextEngine::GetTextLines( LineEnd aSeparator ) const
         for ( size_t nL = 0; nL < nLines; ++nL )
         {
             TextLine& rLine = pTEParaPortion->GetLines()[nL];
-            aText.append( pTEParaPortion->GetNode()->GetText().copy( rLine.GetStart(), rLine.GetEnd() - rLine.GetStart() ) );
+            aText.appendCopy( pTEParaPortion->GetNode()->GetText(), rLine.GetStart(), rLine.GetEnd() - rLine.GetStart() );
             if ( pSep && ( ( (nP+1) < nParas ) || ( (nL+1) < nLines ) ) )
                 aText.append(pSep);
         }
@@ -415,7 +415,7 @@ OUString TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) co
         if ( nNode == nEndPara ) // may also be == nStart!
             nEndPos = aSel.GetEnd().GetIndex();
 
-        aText.append(pNode->GetText().copy( nStartPos, nEndPos-nStartPos ));
+        aText.appendCopy(pNode->GetText(), nStartPos, nEndPos-nStartPos);
         if ( nNode < nEndPara )
             aText.append(pSep);
     }
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 5f3bb6e02e0e..8cfeba05f33b 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1683,9 +1683,9 @@ static OUString getShortenedString( const OUString& i_rLong, vcl::RenderContext
         if (nPos < aNonMnem.getLength() && i_rLong[nPos+1] == aNonMnem[nPos])
         {
             OUStringBuffer aBuf( i_rLong.getLength() );
-            aBuf.append( aNonMnem.copy( 0, nPos) );
+            aBuf.appendCopy( aNonMnem, 0, nPos );
             aBuf.append( '~' );
-            aBuf.append( aNonMnem.copy(nPos) );
+            aBuf.appendCopy( aNonMnem, nPos );
             aNonMnem = aBuf.makeStringAndClear();
         }
     }
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 35be2e7ae4ad..d8019f7ca7fc 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1343,10 +1343,10 @@ static OUString searchAndReplace( const OUString& i_rOrig, const char* i_pRepl,
     if( nPos != -1 )
     {
         OUStringBuffer aBuf( i_rOrig.getLength() );
-        aBuf.append( i_rOrig.getStr(), nPos );
+        aBuf.appendCopy( i_rOrig, nPos );
         aBuf.append( i_rRepl );
         if( nPos + i_nReplLen < i_rOrig.getLength() )
-            aBuf.append( i_rOrig.getStr() + nPos + i_nReplLen );
+            aBuf.appendCopy( i_rOrig, nPos + i_nReplLen );
         return aBuf.makeStringAndClear();
     }
     return i_rOrig;
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index a1afc2bc93a6..60c7b3a3d475 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2204,7 +2204,7 @@ RTFError RTFDocumentImpl::popState()
                                                   - aState.aLevelNumbers.size()));
                         }
                         else
-                            aBuf.append(aOrig.copy(i, 1));
+                            aBuf.appendCopy(aOrig, i, 1);
                     }
 
                     pValue->setString(aBuf.makeStringAndClear());
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();
                         }
 


More information about the Libreoffice-commits mailing list