[Libreoffice-commits] core.git: sc/source
Eike Rathke (via logerrit)
logerrit at kemper.freedesktop.org
Sat Aug 17 10:14:12 UTC 2019
sc/source/ui/docshell/externalrefmgr.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 1d08f0f215dcf5fec9390bd9c84357bc96a9338a
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Fri Aug 16 22:18:57 2019 +0200
Commit: Eike Rathke <erack at redhat.com>
CommitDate: Sat Aug 17 12:13:20 2019 +0200
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 at redhat.com>
Tested-by: Jenkins
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
More information about the Libreoffice-commits
mailing list