summaryrefslogtreecommitdiff
path: root/i18npool/source/breakiterator
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-05-05 12:07:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-06 12:09:48 +0200
commit325c571c22231978e5409902b514d2584186e0a0 (patch)
treec6d84fedf6dee52bff77b07b5d46d4800f109f5f /i18npool/source/breakiterator
parent6276e7c28ed53670fb911ec2bd97a6696583d36b (diff)
update loplugin:stringview* for o3tl::iterateCodePoints
And change o3tl::iterateCodePoints to use sal_Int32 for its second param, to integrate better with places where the parameter comes from an UNO API, which cannot use std::size_t Change-Id: I7b9dd2c9bc7f48e6c4a912f039f1b5dae7beae69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool/source/breakiterator')
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 71d794e2c9d4..5402caa7a469 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -23,6 +23,7 @@
#include <cppuhelper/supportsservice.hxx>
#include <unicode/uchar.h>
#include <i18nutil/unicode.hxx>
+#include <o3tl/string_view.hxx>
#include <com/sun/star/i18n/CharType.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
@@ -72,7 +73,7 @@ sal_Int32 SAL_CALL BreakIteratorImpl::previousCharacters( const OUString& Text,
#define isZWSP(c) (ch == 0x200B)
-static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len, sal_Int16 rWordType, bool bDirection)
+static sal_Int32 skipSpace(std::u16string_view Text, sal_Int32 nPos, sal_Int32 len, sal_Int16 rWordType, bool bDirection)
{
sal_uInt32 ch=0;
sal_Int32 pos=nPos;
@@ -81,7 +82,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
if (bDirection)
while (nPos < len)
{
- ch = Text.iterateCodePoints(&pos);
+ ch = o3tl::iterateCodePoints(Text, &pos);
if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
break;
nPos = pos;
@@ -89,7 +90,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
else
while (nPos > 0)
{
- ch = Text.iterateCodePoints(&pos, -1);
+ ch = o3tl::iterateCodePoints(Text, &pos, -1);
if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
break;
nPos = pos;
@@ -99,7 +100,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
if (bDirection)
while (nPos < len)
{
- ch = Text.iterateCodePoints(&pos);
+ ch = o3tl::iterateCodePoints(Text, &pos);
if (!u_isWhitespace(ch) && !isZWSP(ch) && (ch == 0x002E || u_isalnum(ch)))
break;
nPos = pos;
@@ -107,7 +108,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
else
while (nPos > 0)
{
- ch = Text.iterateCodePoints(&pos, -1);
+ ch = o3tl::iterateCodePoints(Text, &pos, -1);
if (!u_isWhitespace(ch) && !isZWSP(ch) && (ch == 0x002E || u_isalnum(ch)))
break;
nPos = pos;
@@ -117,7 +118,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
if (bDirection)
while (nPos < len)
{
- ch = Text.iterateCodePoints(&pos);
+ ch = o3tl::iterateCodePoints(Text, &pos);
if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
break;
nPos = pos;
@@ -125,7 +126,7 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
else
while (nPos > 0)
{
- ch = Text.iterateCodePoints(&pos, -1);
+ ch = o3tl::iterateCodePoints(Text, &pos, -1);
if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
break;
nPos = pos;