diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-04 11:14:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-05 12:57:00 +0200 |
commit | 9f1701d01d9f664828356976d8592492f85b30f5 (patch) | |
tree | a91eaef0674591af87b06096fdd186283559a8de /svtools | |
parent | b8bb44161aeb6e00526a38343b63e678ce7d4a1a (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 'svtools')
-rw-r--r-- | svtools/source/config/extcolorcfg.cxx | 11 | ||||
-rw-r--r-- | svtools/source/misc/imagemgr.cxx | 12 |
2 files changed, 12 insertions, 11 deletions
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 2ad876b110f1..5a5e2c6c006c 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -34,6 +34,7 @@ #include <mutex> #include <sal/log.hxx> #include <osl/diagnose.h> +#include <o3tl/string_view.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -255,12 +256,12 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme) for(sal_Int32 j = 0;pDispIter != pDispEnd;++pDispIter,++j) { sal_Int32 nIndex = 0; - pDispIter->getToken(0,'/',nIndex); - OUString sName = pDispIter->copy(nIndex); - sName = sName.copy(0,sName.lastIndexOf(sDisplayName)); + o3tl::getToken(*pDispIter, 0, '/', nIndex); + std::u16string_view sName = pDispIter->subView(nIndex); + sName = sName.substr(0, sName.rfind(sDisplayName)); OUString sCurrentDisplayName; aDisplayNamesValue[j] >>= sCurrentDisplayName; - aDisplayNameMap.emplace(sName,sCurrentDisplayName); + aDisplayNameMap.emplace(OUString(sName),sCurrentDisplayName); } } @@ -338,7 +339,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(const uno::Sequence < OUStrin if ( aConfigValues.find(*pColorIter) == aConfigValues.end() ) { sal_Int32 nIndex = 0; - pColorIter->getToken(2,'/',nIndex); + o3tl::getToken(*pColorIter, 2, '/', nIndex); OUString sName(pColorIter->copy(nIndex)),sDisplayName; OUString sTemp = sName.copy(0,sName.lastIndexOf(sColor)); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index e4e933128485..66f786dc190f 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -378,9 +378,9 @@ static SvImageId GetImageId_Impl( if ( rObject.GetProtocol() == INetProtocol::PrivSoffice ) { - OUString aURLPath = sURL.copy( strlen(URL_PREFIX_PRIV_SOFFICE) ); - OUString aType = aURLPath.getToken( 0, '/' ); - if ( aType == "factory" ) + std::u16string_view aURLPath = sURL.subView( strlen(URL_PREFIX_PRIV_SOFFICE) ); + std::u16string_view aType = o3tl::getToken(aURLPath, 0, '/' ); + if ( aType == u"factory" ) { // detect an image id for our "private:factory" urls aExt = GetImageExtensionByFactory_Impl( sURL ); @@ -388,7 +388,7 @@ static SvImageId GetImageId_Impl( nImage = GetImageId_Impl( aExt ); return nImage; } - else if ( aType == "image" ) + else if ( aType == u"image" ) nImage = static_cast<SvImageId>(o3tl::toInt32(o3tl::getToken(aURLPath, 1, '/' ))); } else @@ -758,8 +758,8 @@ OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rOb if ( rObject.GetProtocol() == INetProtocol::PrivSoffice ) { OUString aURLPath = sURL.copy( strlen(URL_PREFIX_PRIV_SOFFICE) ); - OUString aType = aURLPath.getToken( 0, '/' ); - if ( aType == "factory" ) + std::u16string_view aType = o3tl::getToken(aURLPath, 0, '/' ); + if ( aType == u"factory" ) { sDescription = GetDescriptionByFactory_Impl( aURLPath.copy( aURLPath.indexOf( '/' ) + 1 ) ); bDetected = true; |