From e02efb621fe672aa52e56caa916cf5c3fd0a9cb8 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Thu, 1 Feb 2018 15:28:53 +0900 Subject: Change bitmap table to store XBitmap instead of GraphicObject URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tomaž Vajngerl --- include/oox/export/drawingml.hxx | 22 ++++++++++++++++++++++ include/oox/helper/modelobjecthelper.hxx | 5 +++++ 2 files changed, 27 insertions(+) (limited to 'include/oox') diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index c8faa08001fd..2f02f783462c 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -63,6 +63,9 @@ namespace drawing { struct EnhancedCustomShapeParameterPair; struct EnhancedCustomShapeParameter; } +namespace graphic { + class XGraphic; +} namespace style { struct LineSpacing; } @@ -187,18 +190,37 @@ public: const OUString& sURLPropName ); void WriteBlipFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& sURLPropName, sal_Int32 nXmlNamespace ); + + void WriteXGraphicBlipFill(css::uno::Reference const & rXPropSet, + css::uno::Reference const & rxGraphic, + sal_Int32 nXmlNamespace, bool bWriteMode, bool bRelPathToMedia); + void WritePattFill( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WritePattFill(const css::uno::Reference& rXPropSet, const css::drawing::Hatch& rHatch); void WriteSrcRect( const css::uno::Reference< css::beans::XPropertySet >&, const OUString& ); void WriteOutline( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet ); void WriteStretch( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& rURL ); + + void WriteXGraphicStretch(css::uno::Reference const & rXPropSet, + css::uno::Reference const & rxGraphic); + void WriteLinespacing( const css::style::LineSpacing& rLineSpacing ); OUString WriteBlip( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& rURL, bool bRelPathToMedia, const Graphic *pGraphic=nullptr ); + + OUString WriteXGraphicBlip(css::uno::Reference const & rXPropSet, + css::uno::Reference const & rxGraphic, + bool bRelPathToMedia); + + void WriteImageBrightnessContrastTransparence(css::uno::Reference const & rXPropSet); + void WriteBlipMode( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& rURL ); + void WriteXGraphicBlipMode(css::uno::Reference const & rXPropSet, + css::uno::Reference const & rxGraphic); + void WriteShapeTransformation(const css::uno::Reference< css::drawing::XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH = false, bool bFlipV = false, bool bSuppressRotation = false, bool bSuppressFlipping = false, bool bFlippedBeforeRotation = false); void WriteTransformation(const tools::Rectangle& rRectangle, diff --git a/include/oox/helper/modelobjecthelper.hxx b/include/oox/helper/modelobjecthelper.hxx index 986e0c7c5945..67980b57f6c8 100644 --- a/include/oox/helper/modelobjecthelper.hxx +++ b/include/oox/helper/modelobjecthelper.hxx @@ -28,6 +28,7 @@ namespace com { namespace sun { namespace star { namespace awt { struct Gradient; } + namespace graphic { class XGraphic; } namespace container { class XNameContainer; } namespace drawing { struct LineDash; } namespace drawing { struct PolyPolygonBezierCoords; } @@ -107,6 +108,10 @@ public: an internal constant name with a new unused index appended. */ OUString insertFillBitmapUrl( const OUString& rGraphicUrl ); + /** Inserts a new named fill graphic, returns the bitmap name, based on + an internal constant name with a new unused index appended. */ + OUString insertFillBitmapXGraphic(css::uno::Reference const & rxGraphic); + OUString getFillBitmapUrl( const OUString& rGraphicName ); private: -- cgit