diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-02-01 15:28:53 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-02-01 11:54:22 +0100 |
commit | e02efb621fe672aa52e56caa916cf5c3fd0a9cb8 (patch) | |
tree | 725947b541b4774722d9d4a9d11a2ac58463a753 /oox/source/helper/modelobjecthelper.cxx | |
parent | a61747c2c375d1fe404c976d2a03125e4dc78d8f (diff) |
Change bitmap table to store XBitmap instead of GraphicObject URL
As we want to get rid of GraphicObject URLs for the more robust
image life-cycle handling, it was necessary to change the way
bitmap table stores and handles images, so that they always
store a Graphic object (wrapped in UNO object that provides the
XGraphic and XBitmap interface).
In addition this changes loading and saving from ODF (xmloff) and
OOXML (oox) filters so they don't depend on GraphicObject URL
anymore, but load or save directly to / from XGraphic or XBitmap.
Change-Id: I2b88e10056e7d6c920249d59188f86b1a5a32d21
Reviewed-on: https://gerrit.libreoffice.org/49074
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox/source/helper/modelobjecthelper.cxx')
-rw-r--r-- | oox/source/helper/modelobjecthelper.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/oox/source/helper/modelobjecthelper.cxx b/oox/source/helper/modelobjecthelper.cxx index 79f53fe66d28..24f6e7fbb539 100644 --- a/oox/source/helper/modelobjecthelper.cxx +++ b/oox/source/helper/modelobjecthelper.cxx @@ -24,6 +24,8 @@ #include <com/sun/star/drawing/LineDash.hpp> #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/awt/XBitmap.hpp> #include <oox/helper/containerhelper.hxx> #include <oox/helper/helper.hxx> #include <osl/diagnose.h> @@ -134,6 +136,14 @@ OUString ModelObjectHelper::insertFillBitmapUrl( const OUString& rGraphicUrl ) return OUString(); } +OUString ModelObjectHelper::insertFillBitmapXGraphic(uno::Reference<graphic::XGraphic> const & rxGraphic) +{ + uno::Reference<awt::XBitmap> xBitmap(rxGraphic, uno::UNO_QUERY); + if (xBitmap.is()) + return maBitmapUrlContainer.insertObject(maBitmapUrlNameBase, Any(xBitmap), true); + return OUString(); +} + OUString ModelObjectHelper::getFillBitmapUrl( const OUString &rGraphicName ) { Any aAny = maBitmapUrlContainer.getObject( rGraphicName ); |