diff options
author | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-12-18 16:37:16 +0300 |
---|---|---|
committer | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-12-21 11:06:31 +0100 |
commit | e377a29bcf9bc383749edfb5a9d0c0dcbd8dfe59 (patch) | |
tree | ed0b525cf7d496b40335710ce9c0e69c4ca77155 /sfx2 | |
parent | 4cba1d7cdf89e885353db7a806cc39b415b80008 (diff) |
tdf#158375: disable DDE when DisableActiveContent is set
Change-Id: I167f6ea5d740b5a53cd02a9b865e65ff980a8877
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160922
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
(cherry picked from commit 21f8e08c60cde2599f45b9e02c2b7d0cead2f625)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161029
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/appl/lnkbase2.cxx | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index f529fb11d468..a20501a1bad6 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -21,6 +21,7 @@ #include <sfx2/linkmgr.hxx> #include <sfx2/sfxsids.hrc> #include <com/sun/star/document/UpdateDocMode.hpp> +#include <officecfg/Office/Common.hxx> #include <osl/file.hxx> #include <sfx2/objsh.hxx> #include <svl/urihelper.hxx> @@ -281,6 +282,11 @@ void LinkManager::UpdateAllLinks( bool bUpdateGrfLinks, weld::Window* pParentWin ) { + // when active content is disabled don't bother updating all links + // also (when bAskUpdate == true) don't show the pop up. + if(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()) + return; + // First make a copy of the array in order to update links // links in ... no contact between them! std::vector<SvBaseLink*> aTmpArr; @@ -354,8 +360,12 @@ SvLinkSourceRef LinkManager::CreateObj( SvBaseLink const * pLink ) case SvBaseLinkObjectType::ClientOle: return new SvFileObject; case SvBaseLinkObjectType::Internal: + if(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()) + return SvLinkSourceRef(); return new SvxInternalLink; case SvBaseLinkObjectType::ClientDde: + if (officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()) + return SvLinkSourceRef(); return new SvDDEObject; default: return SvLinkSourceRef(); diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 7fd3b3d530d5..eea1751cd57e 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -33,6 +33,7 @@ #include <tools/debug.hxx> #include <svl/svdde.hxx> #include <osl/diagnose.h> +#include <officecfg/Office/Common.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -301,6 +302,9 @@ void SvBaseLink::clearStreamToLoadFrom() bool SvBaseLink::Update() { + if(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()) + return false; + if( isClientType(mnObjType) ) { AddNextRef(); |