diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-02 16:36:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-03 16:30:01 +0200 |
commit | 8bf380f7d33f39eaa4cb96b38a82ac18e589deef (patch) | |
tree | 64b6809f8fe45243a762095d903f91cb093ecf77 /svgio/source/svgreader | |
parent | a56474374b7a5aeacf41419fc1a6c99007cd7483 (diff) |
add o3tl::matchIgnoreAsciiCase
Change-Id: Iad8e1ed256d84808404bf20ed7a16b05b3db5818
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133753
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svgio/source/svgreader')
-rw-r--r-- | svgio/source/svgreader/svgtools.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index c6af0694fc83..9ba7f1d47952 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -402,7 +402,7 @@ namespace svgio::svgreader return false; } - bool readAngle(const OUString& rCandidate, sal_Int32& nPos, double& fAngle, const sal_Int32 nLen) + bool readAngle(std::u16string_view rCandidate, sal_Int32& nPos, double& fAngle, const sal_Int32 nLen) { if(readNumber(rCandidate, nPos, fAngle, nLen)) { @@ -418,18 +418,18 @@ namespace svgio::svgreader if(nPos < nLen) { const sal_Unicode aChar(rCandidate[nPos]); - static const char aStrGrad[] = "grad"; - static const char aStrRad[] = "rad"; + static constexpr std::u16string_view aStrGrad = u"grad"; + static constexpr std::u16string_view aStrRad = u"rad"; switch(aChar) { case u'g' : case u'G' : { - if(rCandidate.matchIgnoreAsciiCase(aStrGrad, nPos)) + if(o3tl::matchIgnoreAsciiCase(rCandidate, aStrGrad, nPos)) { // angle in grad - nPos += strlen(aStrGrad); + nPos += aStrGrad.size(); aType = DegreeType::grad; } break; @@ -437,10 +437,10 @@ namespace svgio::svgreader case u'r' : case u'R' : { - if(rCandidate.matchIgnoreAsciiCase(aStrRad, nPos)) + if(o3tl::matchIgnoreAsciiCase(rCandidate, aStrRad, nPos)) { // angle in radians - nPos += strlen(aStrRad); + nPos += aStrRad.size(); aType = DegreeType::rad; } break; |