diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2018-11-26 21:14:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-12-09 22:15:24 +0100 |
commit | 323d12f278d3b0a51c7c2b8d3a362a27a6a232d3 (patch) | |
tree | 9f7254587d00fa19781cb7bf98960c35a5f73feb /svx | |
parent | ca0cd6985adc7b321b9bc4affe79c4f26eab1722 (diff) |
tdf#120527 svx GraphicObjectShape: handle XBitmap for GraphicURL
This restores compatibility for API users who called getByName() on the
bitmap table and expected that the result can be set as a value for the
GraphicURL property.
The case is similar to the Writer images, which was handled in commit
587803ba46055d43b5b108be744fdde17aeabc7c (sw TextGraphicObject: handle
XBitmap for GraphicURL, 2018-08-08) already.
(cherry picked from commit e30f3e76a9350e2b027d99bba5a46aa0a0ff8256)
Conflicts:
sd/qa/unit/misc-tests.cxx
Change-Id: I3740a68989b306425d0d6c4d4e350ac163cb4170
Reviewed-on: https://gerrit.libreoffice.org/64643
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 6214ef5b360d..ccd37a7250ce 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1367,6 +1367,7 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte case OWN_ATTR_GRAPHIC_URL: { OUString aURL; + uno::Reference<awt::XBitmap> xBitmap; if (rValue >>= aURL) { Graphic aGraphic = vcl::graphic::loadFromURL(aURL); @@ -1376,6 +1377,19 @@ bool SvxGraphicObject::setPropertyValueImpl( const OUString& rName, const SfxIte bOk = true; } } + else if (rValue >>= xBitmap) + { + uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY); + if (xGraphic.is()) + { + Graphic aGraphic = xGraphic; + if (aGraphic) + { + static_cast<SdrGrafObj*>(GetSdrObject())->SetGraphic(aGraphic); + bOk = true; + } + } + } break; } |