summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/dataaccess/ModelImpl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-07 17:37:11 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2019-08-28 22:25:40 +0200
commit35fe064a67b54b0680b4845477c9b8751edda160 (patch)
tree32f344c90c4cd7b8cc4b9fdd5135ddea88617eee /dbaccess/source/core/dataaccess/ModelImpl.cxx
parent4a4e0cb67eab422dffda6f3339031db5b62be77a (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 Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b Reviewed-on: https://gerrit.libreoffice.org/77387 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'dbaccess/source/core/dataaccess/ModelImpl.cxx')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 4f360bfc1ee9..7c175ab5eeb5 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -374,6 +374,7 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XComponentContext >& _r
,m_bSuppressVersionColumns(true)
,m_bModified(false)
,m_bDocumentReadOnly(false)
+ ,m_bMacroCallsSeenWhileLoading(false)
,m_pSharedConnectionManager(nullptr)
,m_nControllerLockCount(0)
{
@@ -407,6 +408,7 @@ ODatabaseModelImpl::ODatabaseModelImpl(
,m_bSuppressVersionColumns(true)
,m_bModified(false)
,m_bDocumentReadOnly(false)
+ ,m_bMacroCallsSeenWhileLoading(false)
,m_pSharedConnectionManager(nullptr)
,m_nControllerLockCount(0)
{
@@ -1271,6 +1273,11 @@ bool ODatabaseModelImpl::documentStorageHasMacros() const
return ( *m_aEmbeddedMacros != eNoMacros );
}
+bool ODatabaseModelImpl::macroCallsSeenWhileLoading() const
+{
+ return m_bMacroCallsSeenWhileLoading;
+}
+
Reference< XEmbeddedScripts > ODatabaseModelImpl::getEmbeddedDocumentScripts() const
{
return Reference< XEmbeddedScripts >( getModel_noCreate(), UNO_QUERY );