diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2018-11-26 21:14:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2018-12-05 17:52:42 +0100 |
commit | 07b098c126cdd01a2ce4335aeb4e1dad134c7f32 (patch) | |
tree | 84326bffb48f41e63956bc0e75698f73e270e565 /svx | |
parent | 9518a9af852f069a268badbc691abb4c09a37be8 (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.
Change-Id: I3740a68989b306425d0d6c4d4e350ac163cb4170
Reviewed-on: https://gerrit.libreoffice.org/64069
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit e30f3e76a9350e2b027d99bba5a46aa0a0ff8256)
Reviewed-on: https://gerrit.libreoffice.org/64427
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 1370119973e0..edc1b77f2a92 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1268,6 +1268,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); @@ -1277,6 +1278,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; } |