summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-11 17:02:50 +0100
committerAndras Timar <andras.timar@collabora.com>2020-05-13 12:30:01 +0200
commit1b991f19e73ac719dcbbc561cb3e4f9ecc646476 (patch)
tree1fcf096e391367c787bf82f36a9eff77719f6fec
parent05ae3574a983219e98c8918d79806843168862c6 (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.cxx9
1 files changed, 8 insertions, 1 deletions
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);
}