sc/source/ui/docshell/externalrefmgr.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 0e7c8c3a1be5c266f8ba7ad42fd9ce80beae5264
Author: Vasily Melenchuk <vasily.melenc...@cib.de>
Date:   Tue Jan 23 13:59:01 2018 +0300

    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 <c...@libreoffice.org>
    Reviewed-by: Eike Rathke <er...@redhat.com>
    (cherry picked from commit 8b98991a66197a71953dbb900dc3aece6b4f9e3a)
    Reviewed-on: https://gerrit.libreoffice.org/48870
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index a83a4799c879..80bd63d1c89d 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2368,6 +2368,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)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to