summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-05-18 10:23:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-05-18 13:38:21 +0200
commit66b4852551aa1838009fac72dc6453bf94de2dd8 (patch)
tree88400708e7ccc117462720c5a4591f8943be8105 /sdext
parentf5ac56c9f7f54bb6603f6f1e8dba06da20f7e0a4 (diff)
Use some more std::string_view
Change-Id: I7d4039e87fda447b1d2087b2430a3544e9a1eb14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115732 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/pdfimport/wrapper/wrapper.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx
index f2439a5bb83c..9bd803d0348f 100644
--- a/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -210,10 +210,10 @@ public:
characters are encoded as pairs of characters: '\\' 'n', resp.
'\\' 'r'. This function converts them back to '\n', resp. '\r'.
*/
-OString lcl_unescapeLineFeeds(const OString& i_rStr)
+OString lcl_unescapeLineFeeds(std::string_view i_rStr)
{
- const size_t nOrigLen(sal::static_int_cast<size_t>(i_rStr.getLength()));
- const char* const pOrig(i_rStr.getStr());
+ const size_t nOrigLen(i_rStr.size());
+ const char* const pOrig(i_rStr.data());
std::unique_ptr<char[]> pBuffer(new char[nOrigLen + 1]);
const char* pRead(pOrig);
@@ -316,7 +316,7 @@ void LineParser::readBinaryData( uno::Sequence<sal_Int8>& rBuf )
uno::Reference<rendering::XPolyPolygon2D> LineParser::readPath()
{
- const OString aSubPathMarker( "subpath" );
+ static const std::string_view aSubPathMarker( "subpath" );
if( readNextToken() != aSubPathMarker )
OSL_PRECOND(false, "broken path");
@@ -332,7 +332,7 @@ uno::Reference<rendering::XPolyPolygon2D> LineParser::readPath()
sal_Int32 nContiguousControlPoints(0);
sal_Int32 nDummy=m_nCharIndex;
- OString aCurrToken( m_aLine.getToken(0,' ',nDummy) );
+ std::string_view aCurrToken( m_aLine.getTokenView(0,' ',nDummy) );
while( m_nCharIndex != -1 && aCurrToken != aSubPathMarker )
{
@@ -366,7 +366,7 @@ uno::Reference<rendering::XPolyPolygon2D> LineParser::readPath()
// one token look-ahead (new subpath or more points?
nDummy=m_nCharIndex;
- aCurrToken = m_aLine.getToken(0,' ',nDummy);
+ aCurrToken = m_aLine.getTokenView(0,' ',nDummy);
}
aResult.append( aSubPath );
@@ -397,7 +397,7 @@ void LineParser::readChar()
OString aChars;
if (m_nCharIndex != -1)
- aChars = lcl_unescapeLineFeeds( m_aLine.copy( m_nCharIndex ) );
+ aChars = lcl_unescapeLineFeeds( m_aLine.subView( m_nCharIndex ) );
// chars gobble up rest of line
m_nCharIndex = -1;
@@ -610,7 +610,7 @@ void LineParser::readFont()
readInt32(nFileLen);
nSize = nSize < 0.0 ? -nSize : nSize;
- aFontName = lcl_unescapeLineFeeds( m_aLine.copy( m_nCharIndex ) );
+ aFontName = lcl_unescapeLineFeeds( m_aLine.subView( m_nCharIndex ) );
// name gobbles up rest of line
m_nCharIndex = -1;
@@ -790,7 +790,7 @@ void LineParser::readLink()
m_parser.m_pSink->hyperLink( aBounds,
OStringToOUString( lcl_unescapeLineFeeds(
- m_aLine.copy(m_nCharIndex) ),
+ m_aLine.subView(m_nCharIndex) ),
RTL_TEXTENCODING_UTF8 ) );
// name gobbles up rest of line
m_nCharIndex = -1;