This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO41X by this push:
new e4c5647288 More checks
e4c5647288 is described below
commit e4c5647288d0594c9c792ff4e7cc7a17b9137476
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Sun Jan 22 21:29:07 2023 +0100
More checks
(cherry picked from commit 2176e6abc35182b5a157b372d39e1f31c92b7afb)
---
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