summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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