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
This commit is contained in:
committed by
Xisco Fauli
parent
5208370de8
commit
9919c42576
@@ -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" )
|
||||
)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user