diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-01-11 11:21:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-01-11 13:55:14 +0100 |
commit | 70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch) | |
tree | bc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /oox/source | |
parent | a0210c5c5e8fd47b55567a8b18788d57d2b7decb (diff) |
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: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/core/relationshandler.cxx | 6 | ||||
-rw-r--r-- | oox/source/dump/dumperbase.cxx | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/oox/source/core/relationshandler.cxx b/oox/source/core/relationshandler.cxx index 16eb928ded2a..9b7675ff2cb1 100644 --- a/oox/source/core/relationshandler.cxx +++ b/oox/source/core/relationshandler.cxx @@ -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(); } diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index d754c6fa9cd9..77b964b43b1e 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -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 |