svx/source/svdraw/svdograf.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 1b991f19e73ac719dcbbc561cb3e4f9ecc646476 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon May 11 17:02:50 2020 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed May 13 12:30:01 2020 +0200 use the LinkManager persist to determine the Referer Change-Id: I4e93878972492a93af368ffa0560412132431a24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93994 Reviewed-by: Stephan Bergmann <sberg...@redhat.com> Reviewed-by: Michael Stahl <michael.st...@cib.de> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index e24e1d8adebc..5fd6f3f5b1b9 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -19,8 +19,10 @@ #include <unotools/streamwrap.hxx> +#include <sfx2/docfile.hxx> #include <sfx2/lnkbase.hxx> #include <math.h> +#include <sfx2/objsh.hxx> #include <tools/helpers.hxx> #include <sot/formats.hxx> #include <sot/storage.hxx> @@ -102,8 +104,13 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj) { sfx2::LinkManager::GetDisplayNames( this, nullptr, &rGrafObj.aFileName, nullptr, &rGrafObj.aFilterName ); + OUString sReferer(getReferer()); + SfxObjectShell * sh = pLinkManager->GetPersist(); + if (sh != nullptr && sh->HasName()) + sReferer = sh->GetMedium()->GetName(); + Graphic aGraphic; - if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, getReferer(), aGraphic, nullptr)) + if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, sReferer, aGraphic, nullptr)) { rGrafObj.ImpSetLinkedGraphic(aGraphic); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits