summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-04 11:14:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-05 12:57:00 +0200
commit9f1701d01d9f664828356976d8592492f85b30f5 (patch)
treea91eaef0674591af87b06096fdd186283559a8de /sw/source/uibase
parentb8bb44161aeb6e00526a38343b63e678ce7d4a1a (diff)
use more o3tl::getToken
found by inspecting call sites of OUString::getToken Change-Id: I4269c7476c7aa46fac39528227e350568f0eb34a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132644 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/dochdl/gloshdl.cxx4
-rw-r--r--sw/source/uibase/envelp/envimg.cxx23
-rw-r--r--sw/source/uibase/misc/glosdoc.cxx4
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx2
4 files changed, 17 insertions, 16 deletions
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx
index 216d4a137b13..3846bdb3e1c5 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -117,8 +117,8 @@ void SwGlossaryHdl::SetCurGroup(const OUString &rGrp, bool bApi, bool bAlwaysCre
break;
}
}
- const OUString sPath = sGroup.getToken(1, GLOS_DELIM);
- sal_uInt16 nComparePath = o3tl::narrowing<sal_uInt16>(sPath.toInt32());
+ const std::u16string_view sPath = o3tl::getToken(sGroup, 1, GLOS_DELIM);
+ sal_uInt16 nComparePath = o3tl::narrowing<sal_uInt16>(o3tl::toInt32(sPath));
if(nCurrentPath == nComparePath &&
o3tl::getToken(sGroup, 0, GLOS_DELIM) == sCurBase)
bPathEqual = true;
diff --git a/sw/source/uibase/envelp/envimg.cxx b/sw/source/uibase/envelp/envimg.cxx
index b676b028f018..317179e570c2 100644
--- a/sw/source/uibase/envelp/envimg.cxx
+++ b/sw/source/uibase/envelp/envimg.cxx
@@ -18,6 +18,7 @@
*/
#include <o3tl/any.hxx>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <editeng/paperinf.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -57,34 +58,34 @@ OUString MakeSender()
sal_Int32 nSttPos = 0;
bool bLastLength = true;
do {
- OUString sToken = sSenderToken.getToken( 0, ';', nSttPos );
- if (sToken == "COMPANY")
+ std::u16string_view sToken = o3tl::getToken(sSenderToken, 0, ';', nSttPos );
+ if (sToken == u"COMPANY")
{
sal_Int32 nOldLen = sRet.getLength();
sRet.append(rUserOpt.GetCompany());
bLastLength = sRet.getLength() != nOldLen;
}
- else if (sToken == "CR")
+ else if (sToken == u"CR")
{
if(bLastLength)
sRet.append(NEXTLINE);
bLastLength = true;
}
- else if (sToken == "FIRSTNAME")
+ else if (sToken == u"FIRSTNAME")
sRet.append(rUserOpt.GetFirstName());
- else if (sToken == "LASTNAME")
+ else if (sToken == u"LASTNAME")
sRet.append(rUserOpt.GetLastName());
- else if (sToken == "ADDRESS")
+ else if (sToken == u"ADDRESS")
sRet.append(rUserOpt.GetStreet());
- else if (sToken == "COUNTRY")
+ else if (sToken == u"COUNTRY")
sRet.append(rUserOpt.GetCountry());
- else if (sToken == "POSTALCODE")
+ else if (sToken == u"POSTALCODE")
sRet.append(rUserOpt.GetZip());
- else if (sToken == "CITY")
+ else if (sToken == u"CITY")
sRet.append(rUserOpt.GetCity());
- else if (sToken == "STATEPROV")
+ else if (sToken == u"STATEPROV")
sRet.append(rUserOpt.GetState());
- else if (!sToken.isEmpty()) //spaces
+ else if (!sToken.empty()) //spaces
sRet.append(sToken);
} while (nSttPos>=0);
return sRet.makeStringAndClear();
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index be7b4291e0bd..28f080af3e1b 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -175,8 +175,8 @@ std::unique_ptr<SwTextBlocks> SwGlossaries::GetGroupDoc(const OUString &rName,
// so that groups remain there later (without access).
bool SwGlossaries::NewGroupDoc(OUString& rGroupName, const OUString& rTitle)
{
- const OUString sNewPath(rGroupName.getToken(1, GLOS_DELIM));
- sal_uInt16 nNewPath = o3tl::narrowing<sal_uInt16>(sNewPath.toInt32());
+ const std::u16string_view sNewPath(o3tl::getToken(rGroupName, 1, GLOS_DELIM));
+ sal_uInt16 nNewPath = o3tl::narrowing<sal_uInt16>(o3tl::toInt32(sNewPath));
if (static_cast<size_t>(nNewPath) >= m_PathArr.size())
return false;
const OUString sNewFilePath(m_PathArr[nNewPath]);
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index 65ca88fd0077..3feb575e47aa 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -317,7 +317,7 @@ void SwGlossaryList::Update()
// for the current subpath.
if( nGroupPath == nPath )
{
- OUString sCompareGroup = pGroup->sName.getToken(0, GLOS_DELIM);
+ std::u16string_view sCompareGroup = o3tl::getToken(pGroup->sName, 0, GLOS_DELIM);
bool bFound = std::any_of(aFoundGroupNames.begin(), aFoundGroupNames.end(),
[&sCompareGroup](const OUString& rGroupName) { return sCompareGroup == rGroupName; });