diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2018-11-26 21:14:39 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2018-11-27 09:04:21 +0100 |
commit | e30f3e76a9350e2b027d99bba5a46aa0a0ff8256 (patch) | |
tree | 442d01520060103be412dbd388caf1bbbc9bb984 /svx | |
parent | a7f57d86c7c67ba3ceb4f4ec27cb1a7826579b3f (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>
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; } |