Kaydet (Commit) 70519a43 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Replace OUStringBuffer::appendCopy with append(std::u16string_view)

...which is more general

Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7
Reviewed-on: https://gerrit.libreoffice.org/66155
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a0210c5c
......@@ -25,6 +25,7 @@
#include <cstddef>
#include <limits>
#include <algorithm>
#include <string_view>
#include <osl/diagnose.h>
#include <com/sun/star/script/ModuleType.hpp>
......@@ -212,7 +213,7 @@ void SbiCodeGen::Save()
{
aIfaceProcName.append(aPropPrefix);
}
aIfaceProcName.appendCopy(aPureProcName, rIfaceName.getLength() + 1 );
aIfaceProcName.append(std::u16string_view(aPureProcName).substr(rIfaceName.getLength() + 1) );
aIfaceName = rIfaceName;
nPassCount = 2;
break;
......
......@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <algorithm>
#include <string_view>
#include <unordered_map>
#include <com/sun/star/beans/XPropertySet.hpp>
......@@ -2050,7 +2050,7 @@ void SbiRuntime::StepRSET()
}
else
{
aNewStr.appendCopy(aRefValString, 0, nVarStrLen);
aNewStr.append(std::u16string_view(aRefValString).substr(0, nVarStrLen));
}
refVar->PutString(aNewStr.makeStringAndClear());
......
......@@ -21,6 +21,7 @@
#include <cstddef>
#include <string.h>
#include <string_view>
#include <vector>
#include <algorithm>
......@@ -443,7 +444,7 @@ OUString removeAny(OUString const& rIn,
{
if (i > 0)
{
buf.appendCopy(rIn, 0, i);
buf.append(std::u16string_view(rIn).substr(0, i));
}
isFound = true;
}
......
......@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <cstddef>
#include <string_view>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
......@@ -553,7 +554,7 @@ void normalize(
} else {
OUStringBuffer buf(path);
buf.append('/');
buf.appendCopy(relative, 0, i);
buf.append(std::u16string_view(relative).substr(0, i));
*normalizedPath = buf.makeStringAndClear();
*name = relative.copy(i + 1);
}
......
......@@ -47,6 +47,7 @@
#include <tools/diagnose_ex.h>
#include <unotools/sharedunocomponent.hxx>
#include <algorithm>
#include <string_view>
namespace dbtools
{
......@@ -132,7 +133,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const
}
else
{
aSql.appendCopy(sTypeName, 0, ++nParenPos);
aSql.append(std::u16string_view(sTypeName).substr(0, ++nParenPos));
}
if ( nPrecision > 0 && nDataType != DataType::TIMESTAMP )
......@@ -149,7 +150,7 @@ OUString createStandardTypePart(const Reference< XPropertySet >& xColProp,const
else
{
nParenPos = sTypeName.indexOf(')',nParenPos);
aSql.appendCopy(sTypeName, nParenPos);
aSql.append(std::u16string_view(sTypeName).substr(nParenPos));
}
}
else
......
......@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/config.h>
#include <string_view>
#include "Clob.hxx"
#include "Blob.hxx"
#include "Connection.hxx"
......@@ -99,7 +103,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition,
if( nCharsToCopy > nLength )
nCharsToCopy = nLength;
// append relevant part of first segment
sSegmentBuffer.appendCopy( sSegment, 0, nCharsToCopy );
sSegmentBuffer.append( std::u16string_view(sSegment).substr(0, nCharsToCopy) );
nActLen += sSegmentBuffer.getLength();
}
}
......@@ -115,7 +119,7 @@ OUString SAL_CALL Clob::getSubString(sal_Int64 nPosition,
RTL_TEXTENCODING_UTF8 );
sal_Int32 nStrLen = sSegment.getLength();
if( nActLen + nStrLen > nLength )
sSegmentBuffer.appendCopy(sSegment, 0, nLength - nActLen);
sSegmentBuffer.append(std::u16string_view(sSegment).substr(0, nLength - nActLen));
else
sSegmentBuffer.append(sSegment);
nActLen += nStrLen;
......
......@@ -16,6 +16,11 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include "Connection.hxx"
#include "PreparedStatement.hxx"
#include "ResultSet.hxx"
......@@ -333,9 +338,9 @@ sal_Int64 toNumericWithoutDecimalPlace(const OUString& sSource)
OUStringBuffer sBuffer(15);
if(nDotIndex > 0)
{
sBuffer.appendCopy(sNumber, 0, nDotIndex);
sBuffer.append(std::u16string_view(sNumber).substr(0, nDotIndex));
}
sBuffer.appendCopy(sNumber, nDotIndex + 1);
sBuffer.append(std::u16string_view(sNumber).substr(nDotIndex + 1));
return sBuffer.makeStringAndClear().toInt64();
}
}
......
......@@ -42,6 +42,7 @@
#include <com/sun/star/deployment/ExtensionManager.hpp>
#include <com/sun/star/task/OfficeRestartManager.hpp>
#include <memory>
#include <string_view>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <salhelper/linkhelper.hxx>
......@@ -266,7 +267,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
{
OUStringBuffer buf;
if (baseURL.getLength() > 1 && baseURL[ baseURL.getLength() - 1 ] == '/')
buf.appendCopy( baseURL, 0, baseURL.getLength() - 1 );
buf.append( std::u16string_view(baseURL).substr(0, baseURL.getLength() - 1) );
else
buf.append( baseURL );
OUString relPath(relPath_);
......
......@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include <dp_misc.h>
#include <dp_ucb.h>
......@@ -216,18 +219,18 @@ bool readLine( OUString * res, OUString const & startingWith,
{
pos = file.indexOf( LF, pos );
if (pos < 0) { // EOF
buf.appendCopy( file, start );
buf.append( std::u16string_view(file).substr(start) );
}
else
{
if (pos > 0 && file[ pos - 1 ] == CR)
{
// consume extra CR
buf.appendCopy( file, start, pos - start - 1 );
buf.append( std::u16string_view(file).substr(start, pos - start - 1) );
++pos;
}
else
buf.appendCopy( file, start, pos - start );
buf.append( std::u16string_view(file).substr(start, pos - start) );
++pos; // consume LF
// check next line:
if (pos < file.getLength() &&
......@@ -271,16 +274,16 @@ bool readProperties( std::vector< std::pair< OUString, OUString> > & out_result,
bool bEOF = false;
pos = file.indexOf( LF, pos );
if (pos < 0) { // EOF
buf.appendCopy( file, start );
buf.append( std::u16string_view(file).substr(start) );
bEOF = true;
}
else
{
if (pos > 0 && file[ pos - 1 ] == CR)
// consume extra CR
buf.appendCopy( file, start, pos - start - 1 );
buf.append( std::u16string_view(file).substr(start, pos - start - 1) );
else
buf.appendCopy( file, start, pos - start );
buf.append( std::u16string_view(file).substr(start, pos - start) );
pos++;
}
OUString aLine = buf.makeStringAndClear();
......
......@@ -65,6 +65,7 @@
#include <limits>
#include <memory>
#include <set>
#include <string_view>
using namespace ::com::sun::star;
......@@ -1642,7 +1643,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.appendCopy( GetString(), nIndex, nEnd - nIndex );
aStr.append( std::u16string_view(GetString()).substr(nIndex, nEnd - nIndex) );
if ( pNextFeature )
{
......
......@@ -18,6 +18,7 @@
*/
#include <memory>
#include <string_view>
#include <sal/config.h>
#include <com/sun/star/io/IOException.hpp>
......@@ -2810,12 +2811,12 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
nTmp++;
if (nTmp < nSttWdPos)
break; // word delimiter found
buf.appendCopy(rTxt, nFndPos, nSttWdPos - nFndPos).append(pFnd->GetLong());
buf.append(std::u16string_view(rTxt).substr(nFndPos, nSttWdPos - nFndPos)).append(pFnd->GetLong());
nFndPos = nSttWdPos + sTmp.getLength();
}
} while (nSttWdPos != -1);
if (nEndPos - nFndPos > extra_repl)
buf.appendCopy(rTxt, nFndPos, nEndPos - nFndPos);
buf.append(std::u16string_view(rTxt).substr(nFndPos, nEndPos - nFndPos));
aLong = buf.makeStringAndClear();
}
SvxAutocorrWord* pNew = new SvxAutocorrWord(aShort, aLong);
......
......@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include "Filter.hxx"
#include <FormComponent.hxx>
#include <strings.hrc>
......@@ -307,7 +311,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.appendCopy( sText, sExpressionMarker.getLength() );
aText.append( std::u16string_view(sText).substr(sExpressionMarker.getLength()) );
else
{
// fallback
......
......@@ -20,6 +20,7 @@
#include <uielement/toolbarsmenucontroller.hxx>
#include <algorithm>
#include <string_view>
#include <services.h>
#include <strings.hrc>
......@@ -394,7 +395,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.appendCopy( aSortedTbs[i].aCommand, n+1 );
aStrBuf.append( std::u16string_view(aSortedTbs[i].aCommand).substr(n+1) );
OUString aCmd( aStrBuf.makeStringAndClear() );
......@@ -666,7 +667,7 @@ void SAL_CALL ToolbarsMenuController::itemSelected( const css::awt::MenuEvent& r
if (( nIndex > 0 ) && (( nIndex+1 ) < aCmd.getLength() ))
{
OUStringBuffer aBuf( "private:resource/toolbar/" );
aBuf.appendCopy( aCmd, nIndex+1 );
aBuf.append( std::u16string_view(aCmd).substr(nIndex+1) );
bool bShow( !pVCLPopupMenu->IsItemChecked( rEvent.MenuId ));
OUString aToolBarResName( aBuf.makeStringAndClear() );
......
......@@ -31,6 +31,7 @@
#include <com/sun/star/i18n/NativeNumberSupplier.hpp>
#include <string.h>
#include <string_view>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::i18n;
......@@ -902,13 +903,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if ( cLast == '\\' )
{ // escaped
aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 2);
aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 2));
aSymbol.append(OUString(&current, 1));
}
else
{
eState = ssStop;
aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
}
postSymbolIndex = nextCharIndex;
}
......@@ -927,13 +928,13 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if ( cLast == '\\' )
{ // escaped
aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 2);
aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 2));
aSymbol.append(OUString(&current, 1));
}
else if (current == nextChar &&
!(nContTypes & KParseTokens::TWO_DOUBLE_QUOTES_BREAK_STRING) )
{ // "" => literal " escaped
aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex);
aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex));
nextCharIndex = index;
if (index < rText.getLength()) { ++nCodePoints; }
nextChar = (index < rText.getLength()) ? rText.iterateCodePoints(&index) : 0;
......@@ -941,7 +942,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
else
{
eState = ssStop;
aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
}
postSymbolIndex = nextCharIndex;
}
......@@ -1050,7 +1051,7 @@ void cclass_Unicode::parseText( ParseResult& r, const OUString& rText, sal_Int32
{
if (postSymbolIndex < nextCharIndex)
{ //! open quote
aSymbol.appendCopy(rText, postSymbolIndex, nextCharIndex - postSymbolIndex - 1);
aSymbol.append(std::u16string_view(rText).substr(postSymbolIndex, nextCharIndex - postSymbolIndex - 1));
r.TokenType |= KParseType::MISSING_QUOTE;
}
r.DequotedNameOrString = aSymbol.toString();
......
......@@ -28,6 +28,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <map>
#include <memory>
#include <string_view>
#include <unordered_map>
#include <com/sun/star/linguistic2/NumberText.hpp>
......@@ -1070,7 +1071,7 @@ OUString getHebrewNativeNumberString(const OUString& aNumberString, bool useGere
makeHebrewNumber(value, output, true, useGeresh);
if (i < len)
output.appendCopy(aNumberString,i);
output.append(std::u16string_view(aNumberString).substr(i));
return output.makeStringAndClear();
}
......@@ -1189,7 +1190,7 @@ OUString getCyrillicNativeNumberString(const OUString& aNumberString)
makeCyrillicNumber(value, output, true);
if (i < len)
output.appendCopy(aNumberString,i);
output.append(std::u16string_view(aNumberString).substr(i));
return output.makeStringAndClear();
}
......
......@@ -24,6 +24,12 @@
#include <cassert>
#include <cstring>
#include <limits>
#include <new>
#if defined LIBO_INTERNAL_ONLY
#include <string_view>
#endif
#include "rtl/ustrbuf.h"
#include "rtl/ustring.hxx"
......@@ -530,46 +536,14 @@ 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 );
#if defined LIBO_INTERNAL_ONLY
OUStringBuffer & append(std::u16string_view sv) {
if (sv.size() > sal_uInt32(std::numeric_limits<sal_Int32>::max())) {
throw std::bad_alloc();
}
return append(sv.data(), sv.size());
}
#endif // LIBO_INTERNAL_ONLY
#endif
/**
Appends the content of a stringbuffer to this string buffer.
......
......@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include <oox/core/relationshandler.hxx>
#include <rtl/ustrbuf.hxx>
......@@ -44,7 +48,7 @@ OUString lclGetRelationsPath( const OUString& rFragmentPath )
return
OUStringBuffer( rFragmentPath.copy( 0, nPathLen ) ). // file path including slash
append( "_rels/" ). // additional '_rels/' path
appendCopy( rFragmentPath, nPathLen ). // file name after path
append( std::u16string_view(rFragmentPath).substr(nPathLen) ). // file name after path
append( ".rels" ). // '.rels' suffix
makeStringAndClear();
}
......
......@@ -20,6 +20,8 @@
#include <oox/dump/dumperbase.hxx>
#include <algorithm>
#include <string_view>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/io/TextOutputStream.hpp>
......@@ -496,7 +498,7 @@ void StringHelper::appendEncString( OUStringBuffer& rStr, const OUString& rData,
if( (nBeg == 0) && (nIdx == nEnd) )
rStr.append( rData );
else
rStr.appendCopy( rData, nBeg, nIdx - nBeg );
rStr.append( std::u16string_view(rData).substr(nBeg, nIdx - nBeg) );
}
// append characters to be encoded
while( (nIdx < nEnd) && (rData[ nIdx ] < 0x20) )
......@@ -562,7 +564,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.appendCopy( rStr, nPos, nEnd - nPos );
aToken.append( std::u16string_view(rStr).substr(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 +587,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.appendCopy( rStr, nPos, nEnd - nPos );
aBuffer.append( std::u16string_view(rStr).substr(nPos, nEnd - nPos) );
if( nEnd < nLen )
aBuffer.append( OOX_DUMP_LF );
// set current position behind list separator
......
......@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/config.h>
#include <string_view>
#include <unicode/regex.h>
#include <comphelper/configuration.hxx>
......@@ -76,7 +80,7 @@ OUString getToken(const OUString& string, sal_Int32& index)
while ((p = token.indexOf('%', i)) >= 0)
{
if (p > i)
result.appendCopy(token, i, p - i);
result.append(std::u16string_view(token).substr(i, p - i));
if (p < token.getLength() - 2)
{
result.append(OUStringLiteral1(token.copy(p+1, 2).toInt32(16)));
......@@ -87,7 +91,7 @@ OUString getToken(const OUString& string, sal_Int32& index)
i = token.getLength();
}
}
result.appendCopy(token,i);
result.append(std::u16string_view(token).substr(i));
return result.makeStringAndClear();
}
......
......@@ -19,6 +19,7 @@
#include <string.h>
#include <string_view>
#include "keyimpl.hxx"
......@@ -987,7 +988,7 @@ OUString ORegKey::getFullPath(OUString const & path) const {
OUStringBuffer b(m_name);
if (!b.isEmpty() && b[b.getLength() - 1] == '/') {
if (path[0] == '/') {
b.appendCopy(path,1);
b.append(std::u16string_view(path).substr(1));
} else {
b.append(path);
}
......
......@@ -35,6 +35,7 @@
#include <osl/diagnose.h>
#include <algorithm>
#include <string_view>
using namespace com::sun::star;
using namespace com::sun::star::uno;
......@@ -755,7 +756,7 @@ void Converter::convertDuration(OUStringBuffer& rBuffer,
if ( aNS.getLength() > 2 )
{
rBuffer.append( '.');
rBuffer.appendCopy( aNS, 2 ); // strip "0."
rBuffer.append( std::u16string_view(aNS).substr(2) ); // strip "0."
}
}
rBuffer.append( 'S');
......
......@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include <address.hxx>
#include <global.hxx>
#include <compiler.hxx>
......@@ -2157,7 +2161,7 @@ static void lcl_ScRange_Format_XL_Header( OUStringBuffer& rString, const ScRange
{
if (!aDocName.isEmpty())
{
rString.append("'[").append(aDocName).append("]").appendCopy(aTabName, 1);
rString.append("'[").append(aDocName).append("]").append(std::u16string_view(aTabName).substr(1));
}
else
{
......
......@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <sfx2/objsh.hxx>
......@@ -921,7 +925,7 @@ OUString lclEncodeDosUrl(
// Excel seems confused by this token).
aBuf.append(EXC_URL_PARENTDIR);
else
aBuf.appendCopy(aOldUrl,0,nPos).append(EXC_URL_SUBDIR);
aBuf.append(std::u16string_view(aOldUrl).substr(0,nPos)).append(EXC_URL_SUBDIR);
aOldUrl = aOldUrl.copy(nPos + 1);
}
......
......@@ -18,6 +18,8 @@
*/
#include <memory>
#include <string_view>
#include <inputhdl.hxx>
#include <scitems.hxx>
#include <editeng/eeitem.hxx>
......@@ -1001,9 +1003,9 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
if (nStartPosition > 0)
{
OUStringBuffer aBuf;
aBuf.appendCopy(aNew, 0, nStartPosition);
aBuf.append(std::u16string_view(aNew).substr(0, nStartPosition));
aBuf.append(u'\x25BA');
aBuf.appendCopy(aNew, nStartPosition);
aBuf.append(std::u16string_view(aNew).substr(nStartPosition));
nArgs = ppFDesc->getParameterCount();
sal_Int16 nVarArgsSet = 0;
if ( nArgs >= PAIRED_VAR_ARGS )
......
......@@ -25,6 +25,7 @@
#include <rtl/ustrbuf.hxx>
#include <algorithm>
#include <string_view>
using namespace pdfi;
......@@ -167,7 +168,7 @@ OUString StyleContainer::getStyleName( sal_Int32 nStyle ) const
else
aStyleName = OStringToOUString( rStyle.Name, RTL_TEXTENCODING_ASCII_US );
sal_Int32 nIndex = aStyleName.lastIndexOf( ':' );
aRet.appendCopy( aStyleName, nIndex+1 );
aRet.append( std::u16string_view(aStyleName).substr(nIndex+1) );
aRet.append( nStyle );
}
}
......
......@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <string_view>
#include "PresenterController.hxx"
#include "PresenterAccessibility.hxx"
......@@ -381,13 +385,13 @@ void PresenterController::UpdatePaneTitles()
if (nStartIndex < 0)
{
// Add the remaining part of the string.
sResult.appendCopy(sTemplate, nIndex);
sResult.append(std::u16string_view(sTemplate).substr(nIndex));
break;
}
else
{
// Add the part preceding the next %.
sResult.appendCopy(sTemplate, nIndex, nStartIndex-nIndex);