diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx index 57c7179a2007..a9a7d074d63d 100644 --- a/include/linguistic/misc.hxx +++ b/include/linguistic/misc.hxx @@ -133,7 +133,7 @@ LNG_DLLPUBLIC bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_In inline bool IsUpper( const OUString &rText, LanguageType nLanguage ) { return IsUpper( rText, 0, rText.getLength(), nLanguage ); } LNG_DLLPUBLIC CapType capitalType(const OUString&, CharClass const *); -LNG_DLLPUBLIC bool HasDigits( const OUString &rText ); +LNG_DLLPUBLIC bool HasDigits( std::u16string_view rText ); LNG_DLLPUBLIC bool IsNumeric( std::u16string_view rText ); diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 5c50af6f1946..f80a849116eb 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -625,14 +626,14 @@ const sal_uInt32 the_aDigitZeroes [] = 0x0001D7CE //1D7FF ; Decimal # Nd [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE }; -bool HasDigits( const OUString &rText ) +bool HasDigits( std::u16string_view rText ) { - const sal_Int32 nLen = rText.getLength(); + const sal_Int32 nLen = rText.size(); sal_Int32 i = 0; while (i < nLen) // for all characters ... { - const sal_uInt32 nCodePoint = rText.iterateCodePoints( &i ); // handle unicode surrogates correctly... + const sal_uInt32 nCodePoint = o3tl::iterateCodePoints( rText, &i ); // handle unicode surrogates correctly... for (unsigned int nDigitZero : the_aDigitZeroes) // ... check in all 0..9 ranges { if (nDigitZero > nCodePoint)