diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-11 13:17:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-11 21:55:11 +0200 |
commit | cde416fea13c6020805ac663e254a50b2c885abd (patch) | |
tree | 30867800e45bb5a3034be83cfebe04e06869389f /scripting | |
parent | c8e144638c10f81a25478dd8d8061d7d870b383c (diff) |
in SetGlobalUNOConstant, only retrieve old value if we need it
removes some unnecessary Find() work
Change-Id: I6af9c4d9a043d4361fcca1a034b2025fe7c10c28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134200
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/basprov/basscript.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index d64fa5af4357..b5a3f6136534 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -242,7 +242,7 @@ constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER = u"Caller"; // if it's a document-based script, temporarily reset ThisComponent to the script invocation context Any aOldThisComponent; if ( m_documentBasicManager && m_xDocumentScriptContext.is() ) - aOldThisComponent = m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", Any( m_xDocumentScriptContext ) ); + m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", Any( m_xDocumentScriptContext ), &aOldThisComponent ); if ( m_caller.hasElements() && m_caller[ 0 ].hasValue() ) { |