Kaydet (Commit) ac8ee6e8 authored tarafından Noel Grandin's avatar Noel Grandin

Revert "add more append methods to *StringBuffer"

This reverts commit 8cfa7f4d.

comment from sberg:
we already have 70519a43 "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: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 3c7354a8
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -481,26 +481,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
*/
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.
......
......@@ -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())) {
......
......@@ -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]);
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 ) );
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment