This is an automated email from the ASF dual-hosted git repository. ardovm pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 2176e6abc3 More checks 2176e6abc3 is described below commit 2176e6abc35182b5a157b372d39e1f31c92b7afb Author: Arrigo Marchiori <ard...@yahoo.it> AuthorDate: Sun Jan 22 21:29:07 2023 +0100 More checks --- main/sfx2/source/appl/appuno.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main/sfx2/source/appl/appuno.cxx b/main/sfx2/source/appl/appuno.cxx index eac20c85de..f1f2e2e5fd 100644 --- a/main/sfx2/source/appl/appuno.cxx +++ b/main/sfx2/source/appl/appuno.cxx @@ -1875,6 +1875,9 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: // check forbids execution return ERRCODE_IO_ACCESSDENIED; } + /* XXX in the original sources this branch was present but its + condition does not make sense. + Let's keep it in case it may be useful for more in-depth checks. else if ( pDoc && pDoc->GetMedium() ) { pDoc->AdjustMacroMode( String() ); @@ -1884,6 +1887,10 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE && pMacroExecModeItem->GetValue() == document::MacroExecMode::NEVER_EXECUTE ) return ERRCODE_IO_ACCESSDENIED; + }*/ + else if ( pCurrent ) { + if ( !pCurrent->AdjustMacroMode( String() ) ) + return ERRCODE_IO_ACCESSDENIED; } // find BASIC method