summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-03 08:50:28 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-03 13:17:37 +0200
commitac8ee6e8f7f2de31e1dc496c1fab953e88e15bba (patch)
treedee587ee89174b613f64806d15e9bcbf61d64510
parent3c7354a85a9bd47a2676aadaad2f6622fe2d959c (diff)
Revert "add more append methods to *StringBuffer"
This reverts commit 8cfa7f4dc00f3dd37e57917ef25c806b0e9e6e73. comment from sberg: we already have 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 "Replace OUStringBuffer::appendCopy with append(std::u16string_view)" (which can be extended to OStringBuffer if needed) Change-Id: Ifcc550a8cf26ef38ad49fde8b067f53c999c9276 Reviewed-on: https://gerrit.libreoffice.org/70178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--bridges/source/cpp_uno/msvc_win32_intel/except.cxx4
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx4
-rw-r--r--include/rtl/strbuf.hxx20
-rw-r--r--include/rtl/ustrbuf.hxx20
-rw-r--r--l10ntools/source/helper.cxx2
-rw-r--r--sc/source/filter/dif/difimp.cxx4
-rw-r--r--svl/source/numbers/zformat.cxx2
-rw-r--r--sw/source/filter/ascii/ascatr.cxx4
-rw-r--r--tools/source/inet/inetmime.cxx12
-rw-r--r--ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx4
-rw-r--r--xmloff/source/style/xmlnumfi.cxx4
11 files changed, 20 insertions, 60 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
index 9f7bc81d71d1..4f761ef3ed20 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
@@ -52,7 +52,7 @@ static inline OUString toUNOname( OUString const & rRTTIname ) throw ()
while (nPos > 0)
{
sal_Int32 n = aStr.lastIndexOf( '@', nPos );
- aRet.append( aStr, n +1, nPos -n -1 );
+ aRet.append( aStr.copy( n +1, nPos -n -1 ) );
if (n >= 0)
{
aRet.append( '.' );
@@ -70,7 +70,7 @@ static inline OUString toRTTIname( OUString const & rUNOname ) throw ()
while (nPos > 0)
{
sal_Int32 n = rUNOname.lastIndexOf( '.', nPos );
- aRet.append( rUNOname, n +1, nPos -n -1 );
+ aRet.append( rUNOname.copy( n +1, nPos -n -1 ) );
aRet.append( '@' );
nPos = n;
}
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index 0961f618aada..385f5f5cb9ed 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -275,7 +275,7 @@ static OUString toUNOname(
while (nPos > 0)
{
sal_Int32 n = aStr.lastIndexOf( '@', nPos );
- aRet.append( aStr, n +1, nPos -n -1 );
+ aRet.append( aStr.copy( n +1, nPos -n -1 ) );
if (n >= 0)
{
aRet.append( '.' );
@@ -295,7 +295,7 @@ static OUString toRTTIname(
while (nPos > 0)
{
sal_Int32 n = rUNOname.lastIndexOf( '.', nPos );
- aRet.append( rUNOname, n +1, nPos -n -1 );
+ aRet.append( rUNOname.copy( n +1, nPos -n -1 ) );
aRet.append( '@' );
nPos = n;
}
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 81100919353b..c674f34d997c 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -482,26 +482,6 @@ public:
}
/**
- Appends a portion of the string to this string buffer.
-
- The characters of the <code>OUString</code> argument are appended, in
- order, to the contents of this string buffer, increasing the
- length of this string buffer by the length of the argument.
-
- @param str a string.
- @param beginIndex the beginning index, inclusive.
- @param count the number of characters.
- @return this string buffer.
- @since Libreoffice 6.4
- */
- OStringBuffer & append(const OString &str, sal_Int32 beginIndex, sal_Int32 count)
- {
- assert( count == 0 || (beginIndex >= 0 && beginIndex < str.getLength()) );
- assert( beginIndex <= str.getLength() - count );
- return append( str.getStr() + beginIndex, count );
- }
-
- /**
Appends the string representation of the <code>char</code> array
argument to this string buffer.
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 9f3c8d1650ff..62ba9f6b2cd7 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -536,26 +536,6 @@ public:
return append( str.getStr(), str.getLength() );
}
- /**
- Appends a portion of the string to this string buffer.
-
- The characters of the <code>OUString</code> argument are appended, in
- order, to the contents of this string buffer, increasing the
- length of this string buffer by the length of the argument.
-
- @param str a string.
- @param beginIndex the beginning index, inclusive.
- @param count the number of characters.
- @return this string buffer.
- @since Libreoffice 6.4
- */
- OUStringBuffer & append(const OUString &str, sal_Int32 beginIndex, sal_Int32 count)
- {
- assert( count == 0 || (beginIndex >= 0 && beginIndex < str.getLength()) );
- assert( beginIndex <= str.getLength() - count );
- return append( str.getStr() + beginIndex, count );
- }
-
#if defined LIBO_INTERNAL_ONLY
OUStringBuffer & append(std::u16string_view sv) {
if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx
index ba1598de2452..c16d104b34e9 100644
--- a/l10ntools/source/helper.cxx
+++ b/l10ntools/source/helper.cxx
@@ -21,7 +21,7 @@ OString escapeAll(
sal_Int32 nUnEscapedOne = rUnEscaped.indexOf(rText[nIndex]);
if( nUnEscapedOne != -1 )
{
- sReturn.append(rEscaped, nUnEscapedOne*2, 2);
+ sReturn.append(rEscaped.copy(nUnEscapedOne*2,2));
}
else
sReturn.append(rText[nIndex]);
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 09121ed7c5fc..4040f4adb67e 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -357,7 +357,7 @@ TOPIC DifParser::GetNextTopic()
OSL_ENSURE( aLine.getLength() >= 2,
"+GetNextTopic(): <String> is too short!" );
if( aLine.getLength() > 2 )
- m_aData.append(aLine, 1, aLine.getLength() - 2);
+ m_aData.append(aLine.copy(1, aLine.getLength() - 2));
else
m_aData.truncate();
eS = S_END;
@@ -556,7 +556,7 @@ DATASET DifParser::GetNextDataset()
}
else if( pLine[nLineLength - 1] == '"' )
{
- m_aData.append(aLine, 0, nLineLength -1);
+ m_aData.append(aLine.copy(0, nLineLength -1));
lcl_DeEscapeQuotesDif(m_aData);
eRet = D_STRING;
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index c7d6954995d6..daa9791dba3c 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1969,7 +1969,7 @@ OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr )
sal_Int32 nEnd;
if ( (nEnd = GetQuoteEnd( rStr, nPos )) >= 0 )
{
- aTmp.append(rStr, nStartPos, ++nEnd - nStartPos );
+ aTmp.append(rStr.copy( nStartPos, ++nEnd - nStartPos ));
nStartPos = nEnd;
}
else
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 91507a698928..ddcc22637923 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -312,14 +312,14 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode )
{
if (nNextAttr <= curRedline.first)
{
- buf.append(aStr, nStrPos, nNextAttr - nStrPos);
+ buf.append(aStr.copy(nStrPos, nNextAttr - nStrPos));
break;
}
else if (nStrPos < curRedline.second)
{
if (nStrPos < curRedline.first)
{
- buf.append(aStr, nStrPos, curRedline.first - nStrPos);
+ buf.append(aStr.copy(nStrPos, curRedline.first - nStrPos));
}
if (curRedline.second <= nNextAttr)
{
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 9a8b463783ba..decd1041a547 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -1350,9 +1350,9 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody)
bDone = true;
break;
}
- sText.append(rBody,
+ sText.append(rBody.copy(
(pEncodedTextCopyBegin - pBegin),
- (q - 1 - pEncodedTextCopyBegin));
+ (q - 1 - pEncodedTextCopyBegin)));
sText.append(sal_Char(nDigit1 << 4 | nDigit2));
q += 2;
pEncodedTextCopyBegin = q;
@@ -1361,18 +1361,18 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody)
case '?':
if (q - pEncodedTextBegin > 1)
- sText.append(rBody,
+ sText.append(rBody.copy(
(pEncodedTextCopyBegin - pBegin),
- (q - 1 - pEncodedTextCopyBegin));
+ (q - 1 - pEncodedTextCopyBegin)));
else
bEncodedWord = false;
bDone = true;
break;
case '_':
- sText.append(rBody,
+ sText.append(rBody.copy(
(pEncodedTextCopyBegin - pBegin),
- (q - 1 - pEncodedTextCopyBegin));
+ (q - 1 - pEncodedTextCopyBegin)));
sText.append(' ');
pEncodedTextCopyBegin = q;
break;
diff --git a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx
index 67020fa20272..531ab229f976 100644
--- a/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonPropFindRequest.cxx
@@ -64,12 +64,12 @@ namespace
inXML[ end - 1 ] == '/' )
{
// copy from original buffer - preserve case.
- buf.append( in, start, end - start );
+ buf.append( in.copy( start, end - start ) );
}
else
{
// copy from original buffer - preserve case.
- buf.append( in, start, end - start + 4 );
+ buf.append( in.copy( start, end - start + 4 ) );
}
start = end + 4;
end = inXML.indexOf( "dav:", start );
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 38530e1a6946..1a7b81c6f311 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -2018,9 +2018,9 @@ void SvXMLNumFormatContext::AddCurrency( const OUString& rContent, LanguageType
// remove both quotes from aFormatCode
OUString aOld = aFormatCode.makeStringAndClear();
if ( nFirst > 0 )
- aFormatCode.append( aOld, 0, nFirst );
+ aFormatCode.append( aOld.copy( 0, nFirst ) );
if ( nLength > nFirst + 2 )
- aFormatCode.append( aOld, nFirst + 1, nLength - nFirst - 2 );
+ aFormatCode.append( aOld.copy( nFirst + 1, nLength - nFirst - 2 ) );
}
}
}