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 | |
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')
-rw-r--r-- | svgio/inc/svgtools.hxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtools.cxx | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/svgio/inc/svgtools.hxx b/svgio/inc/svgtools.hxx index 550c33d88fac..6ef52ae5bf6c 100644 --- a/svgio/inc/svgtools.hxx +++ b/svgio/inc/svgtools.hxx @@ -104,7 +104,7 @@ namespace svgio::svgreader bool readNumber(std::u16string_view rCandidate, sal_Int32& nPos, double& fNum, const sal_Int32 nLen); SvgUnit readUnit(std::u16string_view rCandidate, sal_Int32& nPos, const sal_Int32 nLen); bool readNumberAndUnit(std::u16string_view rCandidate, sal_Int32& nPos, SvgNumber& aNum, const sal_Int32 nLen); - 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); sal_Int32 read_hex(sal_Unicode aChar); bool match_colorKeyword(basegfx::BColor& rColor, const OUString& rName, bool bCaseIndependent); bool read_color(const OUString& rCandidate, basegfx::BColor& rColor, bool bCaseIndependent, SvgNumber& rOpacity); 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; |