summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-11 17:02:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-05-12 21:25:15 +0200
commit3ee652e1c18186a5de47797aa4b02defcb29c210 (patch)
treeab7fd8c512c4375ece4a40b470b00f57387297a8
parent5d101a65c31e6c2f8dd0edffe05f69055cbd481c (diff)
use the LinkManager persist to determine the Referer
Change-Id: I4e93878972492a93af368ffa0560412132431a24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94061 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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 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);
}