Kaydet (Commit) 8b98991a authored tarafından Vasily Melenchuk's avatar Vasily Melenchuk Kaydeden (comit) Eike Rathke

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/48398Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
üst 25399354
......@@ -2365,6 +2365,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment