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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/filter/inc/msfilter.hxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerwordglue.cxx | 13 |
2 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx index 39d6e4d5bf99..0ca05c0ac9f9 100644 --- a/sw/source/filter/inc/msfilter.hxx +++ b/sw/source/filter/inc/msfilter.hxx @@ -84,15 +84,15 @@ namespace sw sal_uLong MSDateTimeFormatToSwFormat(OUString& rParams, SvNumberFormatter *pFormatter, LanguageType &rLang, bool bHijri, LanguageType nDocLang); /*Used to identify if the previous token is AM time field*/ - bool IsPreviousAM(OUString const & rParams, sal_Int32 nPos); + bool IsPreviousAM(std::u16string_view rParams, sal_Int32 nPos); /*Used to identify if the next token is PM time field*/ - bool IsNextPM(OUString const & rParams, sal_Int32 nPos); + bool IsNextPM(std::u16string_view rParams, sal_Int32 nPos); /** Used by MSDateTimeFormatToSwFormat to identify AM time fields */ - bool IsNotAM(OUString const & rParams, sal_Int32 nPos); + bool IsNotAM(std::u16string_view rParams, sal_Int32 nPos); /** Another function used by MSDateTimeFormatToSwFormat diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index b2eb03e4a53a..e0a7fb3bb941 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -25,6 +25,7 @@ #include <algorithm> +#include <o3tl/string_view.hxx> #include <rtl/tencinfo.h> #include <sal/log.hxx> #include <svl/numformat.hxx> @@ -1036,18 +1037,18 @@ namespace sw return nKey; } - bool IsPreviousAM(OUString const & rParams, sal_Int32 nPos) + bool IsPreviousAM(std::u16string_view rParams, sal_Int32 nPos) { - return nPos>=2 && rParams.matchIgnoreAsciiCase("am", nPos-2); + return nPos>=2 && o3tl::matchIgnoreAsciiCase(rParams, u"am", nPos-2); } - bool IsNextPM(OUString const & rParams, sal_Int32 nPos) + bool IsNextPM(std::u16string_view rParams, sal_Int32 nPos) { - return nPos+2<rParams.getLength() && rParams.matchIgnoreAsciiCase("pm", nPos+1); + return o3tl::make_unsigned(nPos+2)<rParams.size() && o3tl::matchIgnoreAsciiCase(rParams, u"pm", nPos+1); } - bool IsNotAM(OUString const & rParams, sal_Int32 nPos) + bool IsNotAM(std::u16string_view rParams, sal_Int32 nPos) { ++nPos; - return nPos>=rParams.getLength() || (rParams[nPos]!='M' && rParams[nPos]!='m'); + return o3tl::make_unsigned(nPos)>=rParams.size() || (rParams[nPos]!='M' && rParams[nPos]!='m'); } void SwapQuotesInField(OUString &rFormat) |