diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-11 17:17:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-12 16:10:37 +0200 |
commit | 19edcfe36b32b15f86cba1eead7932b610e70ce7 (patch) | |
tree | a72c731e7cfbb5ada628f1fa6f945c163ca82c8c /sfx2/source | |
parent | a8d25394a02def4bf1b8d1ad022ea9da25d92935 (diff) |
always use the LinkManager's persist as the known referer
Change-Id: Ibb1bd9138993adbd8391b524c0cd654ba523cad2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94006
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/linkmgr2.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 4c5af8b85cda..8245f6da66ec 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -508,7 +508,6 @@ SotClipboardFormatId LinkManager::RegisterStatusInfoId() bool LinkManager::GetGraphicFromAny(const OUString& rMimeType, const css::uno::Any & rValue, - const OUString& rReferer, Graphic& rGraphic, weld::Window* pParentWin) { @@ -519,8 +518,13 @@ bool LinkManager::GetGraphicFromAny(const OUString& rMimeType, if (rValue.has<OUString>()) { + OUString sReferer; + SfxObjectShell* sh = GetPersist(); + if (sh && sh->HasName()) + sReferer = sh->GetMedium()->GetName(); + OUString sURL = rValue.get<OUString>(); - if (!SvtSecurityOptions().isUntrustedReferer(rReferer)) + if (!SvtSecurityOptions().isUntrustedReferer(sReferer)) rGraphic = vcl::graphic::loadFromURL(sURL, pParentWin); if (rGraphic.IsNone()) rGraphic.SetDefaultType(); |