diff options
-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 6b0b2bc7b44e..0b1f788cd8bf 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> @@ -228,8 +230,13 @@ void SdrGraphicLink::RemoveGraphicUpdater() { 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)) + if (sfx2::LinkManager::GetGraphicFromAny(rMimeType, rValue, sReferer, aGraphic)) { rGrafObj.ImpSetLinkedGraphic(aGraphic); } |