You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2023/01/22 23:01:40 UTC
[openoffice] 02/02: More checks
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 66c30948797c96650e5c20ff7cbc40d66155b7f7
Author: Arrigo Marchiori <ar...@yahoo.it>
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