From 9f1701d01d9f664828356976d8592492f85b30f5 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 4 Apr 2022 11:14:11 +0200 Subject: 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 --- basic/source/classes/eventatt.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'basic/source/classes') diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 6489d88d8339..23185e0ee847 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -184,13 +184,13 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any if( comphelper::string::getTokenCount(aMacro, '.') == 3 ) { sal_Int32 nLast = 0; - OUString aFullLibName = aMacro.getToken( 0, '.', nLast ); + std::u16string_view aFullLibName = o3tl::getToken(aMacro, 0, '.', nLast ); - sal_Int32 nIndex = aFullLibName.indexOf( ':' ); - if (nIndex >= 0) + size_t nIndex = aFullLibName.find( ':' ); + if (nIndex != std::u16string_view::npos) { - aLocation = aFullLibName.copy( 0, nIndex ); - aLibName = aFullLibName.copy( nIndex + 1 ); + aLocation = aFullLibName.substr( 0, nIndex ); + aLibName = aFullLibName.substr( nIndex + 1 ); } aMacro = aMacro.copy( nLast ); -- cgit