summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-08-07 11:06:30 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-07 12:45:46 +0200
commitbba0ccd743a3d023e4829155571cdf0318fcb81c (patch)
treea6c286027b54e5abdcfee29556af49376280b0fa /sw/source/core/unocore
parentc57191e0c45f9735a33953d6b95d54b0e10c876f (diff)
sw TextGraphicObject: fix GraphicURL handling in the descriptor
Commit dfee7d93b4e863d673c45921f79bb876b5738ea6 (sw: get rid of FN_UNO_GRAPHIC_U_R_L and "GraphicURL" property, 2018-03-08) removed support for string-based graphic references, then a later commit restored the setter. But one scenario (when setting the graphic URL before inserting the text graphic object) was still unsupported for real URL setter; restore that as well. Change-Id: I52a7f96e820f614d9d031df3ba03c794984ad68b Reviewed-on: https://gerrit.libreoffice.org/58669 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/unocore')
-rw-r--r--sw/source/core/unocore/unoframe.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index bf25aeb4d4f7..c16f1b301b20 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2748,6 +2748,16 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
{
UnoActionContext aActionContext(pDoc);
Graphic aGraphic;
+
+ // Read graphic URL from the descriptor, if it has any.
+ const ::uno::Any* pGraphicURL;
+ if (m_pProps->GetProperty(FN_UNO_GRAPHIC_URL, 0, pGraphicURL))
+ {
+ OUString sGraphicURL;
+ if (((*pGraphicURL) >>= sGraphicURL) && !sGraphicURL.isEmpty())
+ aGraphic = vcl::graphic::loadFromURL(sGraphicURL);
+ }
+
const ::uno::Any* pGraphicAny;
const bool bHasGraphic = m_pProps->GetProperty(FN_UNO_GRAPHIC, 0, pGraphicAny);
if (bHasGraphic)