From 9919c425762c21dac30b7bfef9c11a5f9847aa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 27 Sep 2026 23:17:31 +0000 Subject: [PATCH] MasterScriptProvider::getScript: match the location to the context exactly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Caolán McNamara Change-Id: Ib569ce5b5a8ccaf56c7922497b920b79a5b7b846 Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13658 Reviewed-by: Noel Grandin Tested-by: Jenkins CPCI (cherry picked from commit ae5d7f7ce564b4cd4656366ee88afa762e457c8f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211527 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- scripting/source/provider/MasterScriptProvider.cxx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index f87373153f0c..c9a15d36aea0 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -51,15 +51,6 @@ using namespace ::sf_misc; namespace func_provider { -static bool endsWith( std::u16string_view target, std::u16string_view item ) -{ - size_t index = target.find( item ); - return index != std::u16string_view::npos && - index == ( target.size() - item.size() ); -} - -/* should be available in some central location. */ - // XScriptProvider implementation @@ -286,7 +277,7 @@ MasterScriptProvider::getScript( const OUString& scriptURI ) if ( ( location == "document" && m_xModel.is() ) - || ( endsWith( m_sCtxString, location ) ) + || ( m_sCtxString == location ) || ( language == "Basic" ) ) {