summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorVasily Melenchuk <Vasily.Melenchuk@cib.de>2018-01-23 13:59:01 +0300
committerAndras Timar <andras.timar@collabora.com>2018-03-06 15:02:33 +0100
commitd4c4813ab19002e5f8bf8b3c49e8edb30663d701 (patch)
tree1d5f088a14f21518a43e13ffcf84e40b259636bb /sc
parent4f7688bcb057370a4a4b73f4c24eda20cafbed1a (diff)
tdf#115044: do not load external documents if it is not allowed
Referenced external document data can be loaded after user permission from dialog or corresponding settings. Change-Id: If3aec37c8bbdee4aebeb99c7807e87c26df8e592 Reviewed-on: https://gerrit.libreoffice.org/48398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 8b98991a66197a71953dbb900dc3aece6b4f9e3a) Reviewed-on: https://gerrit.libreoffice.org/48870 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 0e7c8c3a1be5c266f8ba7ad42fd9ce80beae5264)
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index aefdbdde7af4..af1a27e5043f 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2381,6 +2381,15 @@ ScDocument* ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
if (!pFileName)
return nullptr;
+ // Do not load document until it was allowed
+ SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
+ if ( pDocShell )
+ {
+ const comphelper::EmbeddedObjectContainer& rContainer = pDocShell->GetEmbeddedObjectContainer();
+ if ( !rContainer.getUserAllowsLinkUpdate() )
+ return nullptr;
+ }
+
ScDocument* pSrcDoc = nullptr;
ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));
while (pShell)