[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sc/source

Vasily Melenchuk Vasily.Melenchuk at cib.de
Tue Jan 30 09:13:31 UTC 2018


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

New commits:
commit 86a9b29ffe50a51b65925583d739a78b889b4e15
Author: Vasily Melenchuk <Vasily.Melenchuk at 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 <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/48875
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 90a7c3dc0ac6..c0ddc8a4d415 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2380,6 +2380,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)


More information about the Libreoffice-commits mailing list