summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-07 17:37:11 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-11-20 15:59:53 +0100
commit37381d11906b19e120862d09ca959e23fc6283d7 (patch)
tree0ea81239aff6520b1e24b33790cd8c315f203b5a /scripting
parentd570791b290c7567a24620e76f9e6fa07d1efa82 (diff)
warn on load when a document binds an event to a macro
a) treat shared/Scripts equivalently to document scripts This doesn't automatically warn/block running those scripts when used in a freshly loaded document on its own however because DocumentMacroMode::checkMacrosOnLoading will see at... if ( m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() ) that the document contains no macros and flip the allow macros flag to true so that potentially new uses of macros added by the user during the edit are allowed to run b) so, add an additional flag to indicate existence of use of macros in a document c) for odf import, set it when a script:event-listener tag is encountered d) for html import when registerScriptEvents or SwFormatINetFormat::SetMacroTable is called e) for doc import when Read_F_Macro or StoreMacroCmds is called as well for good measure f) for xls import when registerScriptEvent or ScMacroInfo::SetMacro is called g) for oox import when VbaProject::attachMacros is called Reviewed-on: https://gerrit.libreoffice.org/77387 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 35fe064a67b54b0680b4845477c9b8751edda160) Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index e7cd12a21f0e..85b9f3eccb33 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -124,7 +124,6 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
const URL& aURL, const Sequence < PropertyValue >& lArgs,
const Reference< XDispatchResultListener >& xListener )
{
-
bool bSuccess = false;
Any invokeResult;
bool bCaughtException = false;
@@ -161,12 +160,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
{
xListener->dispatchFinished( aEvent ) ;
}
- catch(RuntimeException & e)
+ catch(const RuntimeException &e)
{
SAL_WARN("scripting",
"ScriptProtocolHandler::dispatchWithNotification: caught RuntimeException"
- "while dispatchFinished with failure of the execution "
- << e );
+ "while dispatchFinished with failure of the execution" << e);
}
}
return;