summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2019-08-16 22:18:57 +0200
committerEike Rathke <erack@redhat.com>2019-08-17 12:13:20 +0200
commit1d08f0f215dcf5fec9390bd9c84357bc96a9338a (patch)
treee29d8b9b6a40922b6509336412ae920809c25fb4
parent202c9a7d826c95fc05db912a8d19c598a240f1cd (diff)
Call isLinkUpdateAllowedInDoc() early in loadSrcDocument()
... so getExternalFileData() and isFileLoadable() aren't called over and over again just to be discarded. Which happens for every formula expression trying to access the document. Change-Id: Id303f9a960d14398ab5c4967346328a8128b60dc Reviewed-on: https://gerrit.libreoffice.org/77614 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index dc1148536414..fc85ad791e4f 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2437,6 +2437,10 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId)
SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUString& rFilter)
{
+ // Do not load document until it was allowed.
+ if (!isLinkUpdateAllowedInDoc(*mpDoc))
+ return nullptr;
+
const SrcFileData* pFileData = getExternalFileData(nFileId);
if (!pFileData)
return nullptr;
@@ -2453,10 +2457,6 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
if (!isFileLoadable(aFile))
return nullptr;
- // Do not load document until it was allowed.
- if (!isLinkUpdateAllowedInDoc(*mpDoc))
- return nullptr;
-
OUString aOptions = pFileData->maFilterOptions;
if ( !pFileData->maFilterName.isEmpty() )
rFilter = pFileData->maFilterName; // don't overwrite stored filter with guessed filter