warn on load when a document binds an event to a macro

Desktop / LibreOffice - Caolán McNamara [redhat.com] - 13 August 2019 11:26 EDT

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/77131

b3edf85e0fe6 warn on load when a document binds an event to a macro
comphelper/source/misc/documentinfo.cxx | 14 ++++++
dbaccess/source/core/dataaccess/ModelImpl.cxx | 7 +++
.../source/core/dataaccess/databasedocument.cxx | 25 ++++++----
dbaccess/source/core/inc/ModelImpl.hxx | 2 +
include/comphelper/documentinfo.hxx | 5 +-
include/oox/ole/axcontrol.hxx | 2 +
include/sfx2/docmacromode.hxx | 7 +++
include/sfx2/objsh.hxx | 3 ++
include/xmloff/xmlimp.hxx | 3 ++
oox/source/ole/vbaproject.cxx | 4 ++
sc/source/filter/excel/xiescher.cxx | 36 ++++++++++++--
sc/source/filter/inc/xiescher.hxx | 11 ++++-
sc/source/ui/vba/vbasheetobject.cxx | 13 ++++-
sc/source/ui/vba/vbasheetobject.hxx | 4 ++
scripting/source/protocolhandler/scripthandler.cxx | 55 +++++++++-------------
sfx2/source/doc/docmacromode.cxx | 2 +-
sfx2/source/doc/objmisc.cxx | 13 +++--
sfx2/source/doc/objstor.cxx | 10 ++++
sfx2/source/doc/objxtor.cxx | 1 +
sfx2/source/doc/sfxbasemodel.cxx | 7 +++
sfx2/source/inc/objshimp.hxx | 4 +-
sw/source/filter/html/htmlform.cxx | 16 +++++--
sw/source/filter/html/htmlgrin.cxx | 19 ++++++++
sw/source/filter/html/swhtml.cxx | 1 +
sw/source/filter/html/swhtml.hxx | 3 ++
sw/source/filter/ww8/ww8par.cxx | 13 +++++
sw/source/filter/ww8/ww8par.hxx | 2 +
sw/source/filter/ww8/ww8par5.cxx | 2 +
xmloff/source/core/xmlimp.cxx | 14 +++++-
xmloff/source/script/XMLEventImportHelper.cxx | 3 +-
30 files changed, 236 insertions(+), 65 deletions(-)

Upstream: cgit.freedesktop.org


  • Share