From e4ff847fe0796420ba8023b70cad8589f5f19e9f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 9 Apr 2022 09:55:12 +0200 Subject: loplugin:stringview check for getToken and trim since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/core/CustomAnimationPreset.cxx | 3 ++- sd/source/filter/ppt/pptin.cxx | 3 ++- sd/source/ui/dlg/tpaction.cxx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'sd') diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index e6b9fff68807..d7c19401dc81 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -192,7 +193,7 @@ bool CustomAnimationPreset::hasProperty( std::u16string_view rProperty )const sal_Int32 nPos = 0; do { - if (maProperty.getToken(0, ';', nPos) == rProperty) + if (o3tl::getToken(maProperty, 0, ';', nPos) == rProperty) return true; } while (nPos >= 0); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 3d9ed7dfc14a..1e7abd43bdfd 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -425,7 +426,7 @@ bool ImplSdPPTImport::Import() do { aStringAry[nTokenCount] = - OUStringToOString(aString.getToken( 0, ',', nPos ), RTL_TEXTENCODING_UTF8); + OUStringToOString(o3tl::getToken(aString, 0, ',', nPos ), RTL_TEXTENCODING_UTF8); } while ( ++nTokenCount < SAL_N_ELEMENTS(aStringAry) && nPos >= 0 ); diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 03f3080ba22e..c5ccd758a321 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -314,7 +315,7 @@ void SdTPAction::Reset( const SfxItemSet* rAttrs ) case presentation::ClickAction_DOCUMENT: { if( comphelper::string::getTokenCount(aFileName, DOCUMENT_TOKEN) == 2 ) - m_xLbTreeDocument->SelectEntry( aFileName.getToken( 1, DOCUMENT_TOKEN ) ); + m_xLbTreeDocument->SelectEntry( o3tl::getToken(aFileName, 1, DOCUMENT_TOKEN ) ); } break; -- cgit