diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-02-26 11:15:37 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-02-26 06:04:43 +0100 |
commit | 3400424877032595490f38711b5e8520ed889fee (patch) | |
tree | 970b521dd0c5d18f37362ec53ebd52c3fa80f5e9 /svx | |
parent | 6fa55d39bc43383fcdb3276e9b7f612fa96d1b67 (diff) |
xmloff: remove unused code when loading/saving the bitmap table
Change-Id: I6bffe243e813079538a4cb57111266b41d7c03f1
Reviewed-on: https://gerrit.libreoffice.org/50333
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/XPropertyTable.cxx | 9 | ||||
-rw-r--r-- | svx/source/xml/xmlxtimp.cxx | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index 86e530a3eca6..a2675cafa5f5 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -625,8 +625,17 @@ std::unique_ptr<XPropertyEntry> SvxUnoXBitmapTable::createEntry(const OUString& return std::unique_ptr<XPropertyEntry>(); auto xBitmap = rAny.get<uno::Reference<awt::XBitmap>>(); + if (!xBitmap.is()) + return nullptr; + uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY); + if (!xGraphic.is()) + return nullptr; + Graphic aGraphic(xGraphic); + if (!aGraphic) + return nullptr; + GraphicObject aGraphicObject(aGraphic); return o3tl::make_unique<XBitmapEntry>(aGraphicObject, rName); } diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index 6005a5c0199d..af5215c99582 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -285,12 +285,6 @@ void SvxXMLTableImportContext::importBitmap( const uno::Reference< XAttributeLis if (xBitmap.is()) rAny <<= xBitmap; } - else if (aGraphicAny.has<uno::Reference<awt::XBitmap>>()) - { - auto xBitmap = aGraphicAny.get<uno::Reference<awt::XBitmap>>(); - if (xBitmap.is()) - rAny <<= xBitmap; - } } catch (const Exception&) { |