diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-11 17:02:50 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2020-05-13 12:13:04 +0200 |
commit | 89229809508f863999881088a23cae404f94c974 (patch) | |
tree | cc30f4e40d5abe5db9b59e60a710e458074cf805 | |
parent | 0b75202fe6a08ecc47340a8ed0845ec5cfe19b56 (diff) |
use the LinkManager persist to determine the Referer
Change-Id: I4e93878972492a93af368ffa0560412132431a24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93994
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | svx/source/svdraw/svdograf.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 7e14a6d3bdd9..53b3e00a35fc 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/exchange.hxx> #include <sot/formats.hxx> @@ -109,8 +111,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); } |