diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-05-03 06:56:52 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-05-03 06:56:52 +0000 |
commit | 20e207359f4e686ada3cf8d826f35032c85434f1 (patch) | |
tree | d48ee2c0b274be9d077ad013e7fb6269338a672f /basctl | |
parent | e0f679ea61b9a53b6026e5d8f6b8bbf7cfb989c0 (diff) |
INTEGRATION: CWS macrosecurity2 (1.30.50); FILE MERGED
2004/04/21 13:35:24 tbe 1.30.50.1: #116444# Security RunMacro=Never misleading
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index bfa1699300b7..fa5e2f9e8423 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: baside2.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: vg $ $Date: 2004-01-06 17:11:19 $ + * last change: $Author: rt $ $Date: 2004-05-03 07:56:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,6 +93,9 @@ #ifndef _COM_SUN_STAR_SCRIPT_XLIBRYARYCONTAINER2_HPP_ #include <com/sun/star/script/XLibraryContainer2.hpp> #endif +#ifndef _COM_SUN_STAR_DOCUMENT_MACROEXECMODE_HPP_ +#include <com/sun/star/document/MacroExecMode.hpp> +#endif #ifndef _SFXDOCFILE_HXX //autogen #include <sfx2/docfile.hxx> @@ -350,6 +353,19 @@ void ModulWindow::CheckCompileBasic() BOOL ModulWindow::BasicExecute() { DBG_CHKTHIS( ModulWindow, 0 ); + + // #116444# check security settings before macro execution + SfxObjectShell* pShell = GetShell(); + if ( pShell ) + { + pShell->AdjustMacroMode( String() ); + if ( pShell->GetMacroMode() == ::com::sun::star::document::MacroExecMode::NEVER_EXECUTE ) + { + WarningBox( this, WB_OK, String( IDEResId( RID_STR_CANNOTRUNMACRO ) ) ).Execute(); + return FALSE; + } + } + CheckCompileBasic(); if ( xModule.Is() && xModule->IsCompiled() && !aStatus.bError ) |