diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 21:00:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-14 11:24:53 +0200 |
commit | 41fa4bb83ad95f0b2171808b405fa755613cef81 (patch) | |
tree | ef9ba4a399ea497d8ce8841d762fbefcf06ad224 /filter/source/msfilter | |
parent | 14f6700fefa945c4cf995c09af9326c2a022f886 (diff) |
use more string_view in filter
Change-Id: Ieff65b96487051721f9016c005523f31b7415901
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132984
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter/source/msfilter')
-rw-r--r-- | filter/source/msfilter/util.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index a1d3929a218c..7747c9a0ecd1 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -309,19 +309,19 @@ const ApiPaperSize& PaperSizeConv::getApiSizeForMSPaperSizeIndex( sal_Int32 nMSO return spPaperSizeTable[ nMSOPaperIndex ]; } -OUString findQuotedText( const OUString& rCommand, +std::u16string_view findQuotedText( std::u16string_view rCommand, const char* cStartQuote, const sal_Unicode uEndQuote ) { - OUString sRet; + std::u16string_view sRet; OUString sStartQuote( OUString::createFromAscii(cStartQuote) ); - sal_Int32 nStartIndex = rCommand.indexOf( sStartQuote ); - if( nStartIndex >= 0 ) + size_t nStartIndex = rCommand.find( sStartQuote ); + if( nStartIndex != std::u16string_view::npos ) { sal_Int32 nStartLength = sStartQuote.getLength(); - sal_Int32 nEndIndex = rCommand.indexOf( uEndQuote, nStartIndex + nStartLength); - if( nEndIndex > nStartIndex ) + size_t nEndIndex = rCommand.find( uEndQuote, nStartIndex + nStartLength); + if( nEndIndex != std::u16string_view::npos && nEndIndex > nStartIndex ) { - sRet = rCommand.copy( nStartIndex + nStartLength, nEndIndex - nStartIndex - nStartLength); + sRet = rCommand.substr( nStartIndex + nStartLength, nEndIndex - nStartIndex - nStartLength); } } return sRet; |