summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-02-01 15:28:53 +0900
committerTomaž Vajngerl <quikee@gmail.com>2018-02-01 11:54:22 +0100
commite02efb621fe672aa52e56caa916cf5c3fd0a9cb8 (patch)
tree725947b541b4774722d9d4a9d11a2ac58463a753 /include
parenta61747c2c375d1fe404c976d2a03125e4dc78d8f (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 'include')
-rw-r--r--include/oox/export/drawingml.hxx22
-rw-r--r--include/oox/helper/modelobjecthelper.hxx5
-rw-r--r--include/xmloff/xmlexp.hxx5
-rw-r--r--include/xmloff/xmlimp.hxx5
4 files changed, 36 insertions, 1 deletions
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<css::beans::XPropertySet> const & rXPropSet,
+ css::uno::Reference<css::graphic::XGraphic> 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<css::beans::XPropertySet>& 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<css::beans::XPropertySet> const & rXPropSet,
+ css::uno::Reference<css::graphic::XGraphic> 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<css::beans::XPropertySet> const & rXPropSet,
+ css::uno::Reference<css::graphic::XGraphic> const & rxGraphic,
+ bool bRelPathToMedia);
+
+ void WriteImageBrightnessContrastTransparence(css::uno::Reference<css::beans::XPropertySet> const & rXPropSet);
+
void WriteBlipMode( const css::uno::Reference< css::beans::XPropertySet >& rXPropSet, const OUString& rURL );
+ void WriteXGraphicBlipMode(css::uno::Reference<css::beans::XPropertySet> const & rXPropSet,
+ css::uno::Reference<css::graphic::XGraphic> 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<css::graphic::XGraphic> const & rxGraphic);
+
OUString getFillBitmapUrl( const OUString& rGraphicName );
private:
diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx
index fe73d0d6ab5d..203be8fdfd0f 100644
--- a/include/xmloff/xmlexp.hxx
+++ b/include/xmloff/xmlexp.hxx
@@ -48,6 +48,7 @@
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XGraphicObjectResolver.hpp>
#include <com/sun/star/document/XEmbeddedObjectResolver.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
@@ -461,6 +462,10 @@ public:
OUString AddEmbeddedGraphicObject(
const OUString& rGraphicObjectURL );
+
+ OUString AddEmbeddedXGraphic(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic);
+ bool AddEmbeddedXGraphicAsBase64(css::uno::Reference<css::graphic::XGraphic> const & rxGraphic);
+
css::uno::Reference<css::io::XInputStream> GetEmbeddedGraphicObjectStream(
const OUString& rGraphicObjectURL);
bool AddEmbeddedGraphicObjectAsBase64(
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx
index 339b8cdf7a54..50c4e0f10612 100644
--- a/include/xmloff/xmlimp.hxx
+++ b/include/xmloff/xmlimp.hxx
@@ -27,6 +27,7 @@
#include <xmloff/dllapi.h>
#include <sal/types.h>
+#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
@@ -158,7 +159,6 @@ public:
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override;
};
-
class XMLOFF_DLLPUBLIC SvXMLImport : public cppu::WeakImplHelper<
css::xml::sax::XExtendedDocumentHandler,
css::xml::sax::XFastDocumentHandler,
@@ -400,9 +400,12 @@ public:
mxNumberFormatsSupplier = _xNumberFormatSupplier;
}
+ css::uno::Reference<css::graphic::XGraphic> loadGraphicByURL(const OUString& rURL);
+
// Convert a local package URL into either a graphic manager or a
// internal package URL. The later one happens only if bLoadURL is true
OUString ResolveGraphicObjectURL( const OUString& rURL, bool bLoadOnDemand );
+
css::uno::Reference< css::io::XOutputStream >
GetStreamForGraphicObjectURLFromBase64();
OUString ResolveGraphicObjectURLFromBase64(