summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-12-18 16:37:16 +0300
committerSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-12-21 11:06:31 +0100
commite377a29bcf9bc383749edfb5a9d0c0dcbd8dfe59 (patch)
treeed0b525cf7d496b40335710ce9c0e69c4ca77155 /svl
parent4cba1d7cdf89e885353db7a806cc39b415b80008 (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 'svl')
-rw-r--r--svl/source/svdde/ddecli.cxx17
-rw-r--r--svl/source/svdde/ddesvr.cxx17
2 files changed, 22 insertions, 12 deletions
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index 7ad4c1e097b3..835bdf2269c6 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -22,6 +22,7 @@
#include <algorithm>
#include "ddeimp.hxx"
#include <svl/svdde.hxx>
+#include <officecfg/Office/Common.hxx>
#include <osl/thread.h>
#include <comphelper/solarmutex.hxx>
@@ -150,12 +151,16 @@ DdeConnection::DdeConnection( const OUString& rService, const OUString& rTopic )
pInst->nInstanceCli++;
if ( !pInst->hDdeInstCli )
{
- pImp->nStatus = DdeInitializeW( &pInst->hDdeInstCli,
- DdeInternal::CliCallback,
- APPCLASS_STANDARD | APPCMD_CLIENTONLY |
- CBF_FAIL_ALLSVRXACTIONS |
- CBF_SKIP_REGISTRATIONS |
- CBF_SKIP_UNREGISTRATIONS, 0L );
+ pImp->nStatus = DMLERR_SYS_ERROR;
+ if ( !officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+ {
+ pImp->nStatus = DdeInitializeW( &pInst->hDdeInstCli,
+ DdeInternal::CliCallback,
+ APPCLASS_STANDARD | APPCMD_CLIENTONLY |
+ CBF_FAIL_ALLSVRXACTIONS |
+ CBF_SKIP_REGISTRATIONS |
+ CBF_SKIP_UNREGISTRATIONS, 0L );
+ }
}
pService = new DdeString( pInst->hDdeInstCli, rService );
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 327fb9a8f5d3..3df8b5a570a5 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -26,6 +26,7 @@
#include <osl/thread.h>
#include <o3tl/sorted_vector.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
+#include <officecfg/Office/Common.hxx>
namespace {
@@ -354,12 +355,16 @@ DdeService::DdeService( const OUString& rService )
if ( !pInst->hDdeInstSvr )
{
- nStatus = sal::static_int_cast< short >(
- DdeInitializeW( &pInst->hDdeInstSvr,
- DdeInternal::SvrCallback,
- APPCLASS_STANDARD |
- CBF_SKIP_REGISTRATIONS |
- CBF_SKIP_UNREGISTRATIONS, 0 ) );
+ nStatus = DMLERR_SYS_ERROR;
+ if ( !officecfg::Office::Common::Security::Scripting::DisableActiveContent::get() )
+ {
+ nStatus = sal::static_int_cast< short >(
+ DdeInitializeW( &pInst->hDdeInstSvr,
+ DdeInternal::SvrCallback,
+ APPCLASS_STANDARD |
+ CBF_SKIP_REGISTRATIONS |
+ CBF_SKIP_UNREGISTRATIONS, 0 ) );
+ }
pInst->pServicesSvr = new DdeServices;
}
else