diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-11 17:02:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-12 16:08:55 +0200 |
commit | a8d25394a02def4bf1b8d1ad022ea9da25d92935 (patch) | |
tree | 91c70f8e929a12e62faf16f2f4b5f1dff19de672 /svx | |
parent | 86472954f91342e683e4cafa016bc02387dbbb56 (diff) |
use the LinkManager persist to determine the Referer
Change-Id: I4e93878972492a93af368ffa0560412132431a24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93984
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-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 5c216bd2835d..b0a13593845c 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -19,7 +19,9 @@ #include <unotools/streamwrap.hxx> +#include <sfx2/docfile.hxx> #include <sfx2/lnkbase.hxx> +#include <sfx2/objsh.hxx> #include <rtl/ustrbuf.hxx> #include <tools/helpers.hxx> #include <tools/stream.hxx> @@ -90,8 +92,13 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj) { sfx2::LinkManager::GetDisplayNames( this, nullptr, &rGrafObj.aFileName, nullptr, &rGrafObj.aFilterName ); + OUString sReferer(rGrafObj.aReferer); + SfxObjectShell * sh = pLinkManager->GetPersist(); + if (sh != nullptr && sh->HasName()) + sReferer = sh->GetMedium()->GetName(); + Graphic aGraphic; - if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, rGrafObj.aReferer, aGraphic, nullptr)) + if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, sReferer, aGraphic, nullptr)) { rGrafObj.ImpSetLinkedGraphic(aGraphic); } |