diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-22 12:59:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-03-08 07:06:13 +0100 |
commit | 7840effb1d5efd1fd7f6798c7c504b05292a7793 (patch) | |
tree | 845e03d4c2cfad1d5bbcaaf9dc3ec1aeece7c864 /sdext/source | |
parent | bf35f2b36fc00f9b37397422b2ee425c6a697540 (diff) |
use more string_view
found by tweaking the stringview loplugin
Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/pdfimport/inc/pdfiprocessor.hxx | 2 | ||||
-rw-r--r-- | sdext/source/pdfimport/tree/pdfiprocessor.cxx | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sdext/source/pdfimport/inc/pdfiprocessor.hxx b/sdext/source/pdfimport/inc/pdfiprocessor.hxx index 89a09d1780bf..11b7761d1738 100644 --- a/sdext/source/pdfimport/inc/pdfiprocessor.hxx +++ b/sdext/source/pdfimport/inc/pdfiprocessor.hxx @@ -81,7 +81,7 @@ namespace pdfi static void sortElements( Element* pElement ); - static OUString SubstituteBidiMirrored(const OUString& rString); + static OUString SubstituteBidiMirrored(std::u16string_view rString); private: void processGlyphLine(); diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index 2483144250b8..d60431dbce09 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -36,6 +36,7 @@ #include <basegfx/utils/canvastools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <i18nutil/unicode.hxx> +#include <o3tl/string_view.hxx> using namespace com::sun::star; @@ -763,13 +764,13 @@ void PDFIProcessor::sortElements(Element* pEle) /* Produce mirrored-image for each code point which has the Bidi_Mirrored property, within a string. This need to be done in forward order. */ -OUString PDFIProcessor::SubstituteBidiMirrored(const OUString& rString) +OUString PDFIProcessor::SubstituteBidiMirrored(std::u16string_view rString) { - const sal_Int32 nLen = rString.getLength(); + const sal_Int32 nLen = rString.size(); OUStringBuffer aMirror(nLen); for (sal_Int32 i = 0; i < nLen;) { - const sal_uInt32 nCodePoint = rString.iterateCodePoints(&i); + const sal_uInt32 nCodePoint = o3tl::iterateCodePoints(rString, &i); aMirror.appendUtf32(unicode::GetMirroredChar(nCodePoint)); } return aMirror.makeStringAndClear(); |