summaryrefslogtreecommitdiffstats
path: root/include/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-07 17:37:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-08-15 21:36:42 +0200
commita661549b70d30d8925e9839ca97e832111f289b5 (patch)
tree954873a9ccf5a717ab4a157a09437c48d6144151 /include/sfx2
parentRelated: tdf#126931 abbreviated month names should be three letters (diff)
downloadcore-a661549b70d30d8925e9839ca97e832111f289b5.tar.gz
core-a661549b70d30d8925e9839ca97e832111f289b5.zip
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 Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b Reviewed-on: https://gerrit.libreoffice.org/77386 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/sfx2')
-rw-r--r--include/sfx2/docmacromode.hxx7
-rw-r--r--include/sfx2/objsh.hxx3
2 files changed, 10 insertions, 0 deletions
diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx
index efd41f7bdc92..a15bbbe9ba56 100644
--- a/include/sfx2/docmacromode.hxx
+++ b/include/sfx2/docmacromode.hxx
@@ -113,6 +113,12 @@ namespace sfx2
virtual bool
documentStorageHasMacros() const = 0;
+ /** checks whether the document's contained calls to macros or scripts after loading
+
+ */
+ virtual bool
+ macroCallsSeenWhileLoading() const = 0;
+
/** provides access to the XEmbeddedScripts interface of the document
Implementations are allowed to return <NULL/> here if and only if they
@@ -274,6 +280,7 @@ namespace sfx2
@see isMacroExecutionDisallowed
@see IMacroDocumentAccess::documentStorageHasMacros
+ @see IMacroDocumentAccess::macroCallsSeenWhileLoading
@see hasMacroLibrary
@see IMacroDocumentAccess::checkForBrokenScriptingSignatures
*/
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index d982aa1d20d7..4db1c5769e80 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -414,6 +414,9 @@ public:
sal_uInt32 GetModifyPasswordHash() const;
bool SetModifyPasswordHash( sal_uInt32 nHash );
+ void SetMacroCallsSeenWhileLoading();
+ bool GetMacroCallsSeenWhileLoading() const;
+
const css::uno::Sequence< css::beans::PropertyValue >& GetModifyPasswordInfo() const;
bool SetModifyPasswordInfo( const css::uno::Sequence< css::beans::PropertyValue >& aInfo );