sfx2/source/doc/iframe.cxx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
New commits: commit 28338b9bab0bde32374fb408dba5100cc99a20d2 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Jun 20 10:20:36 2023 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jun 29 13:54:58 2023 +0200 Resolves: tdf#155750 allow private:factory urls in floating frames they create a new document so there isn't an associated location which would trigger the prompt to allow it so just allow factory urls Change-Id: I7b693bcfe5ac04aaed06905637ab3c1eba43c51f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153330 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index 4f3b414d5d69..150218b436e9 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -174,14 +174,18 @@ sal_Bool SAL_CALL IFrameObject::load( uno::Reference<frame::XFramesSupplier> xParentFrame = xFrame->getCreator(); SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame); - bool bUpdateAllowed(true); - if (pDoc) + const bool bIsFactoryURL = aTargetURL.Complete.startsWith("private:factory/"); + if (!bIsFactoryURL) { - comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer(); - bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); + bool bUpdateAllowed(true); + if (pDoc) + { + comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = pDoc->getEmbeddedObjectContainer(); + bUpdateAllowed = rEmbeddedObjectContainer.getUserAllowsLinkUpdate(); + } + if (!bUpdateAllowed) + return false; } - if (!bUpdateAllowed) - return false; OUString sReferer; if (pDoc && pDoc->HasName())