MasterScriptProvider::getScript: match the location to the context exactly

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ib569ce5b5a8ccaf56c7922497b920b79a5b7b846
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13658
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit ae5d7f7ce564b4cd4656366ee88afa762e457c8f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211527
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
(cherry picked from commit 9919c42576)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211540
This commit is contained in:
Caolán McNamara
2026-09-30 08:42:42 +02:00
committed by Xisco Fauli
parent 5da04a4d8e
commit ed50cfef03
@@ -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" )
)
{