diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-29 09:25:21 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-29 09:26:14 +0200 |
commit | 9f6dd9a4cff12460d09a31a065feaf8fece1eb4b (patch) | |
tree | b8281e867c22a37c0ce7971b5d4669703acdb493 /oox | |
parent | Java cleanup - remove unnecessary null checks (diff) | |
download | core-9f6dd9a4cff12460d09a31a065feaf8fece1eb4b.tar.gz core-9f6dd9a4cff12460d09a31a065feaf8fece1eb4b.zip |
n#777345 import imagedata of v:rect elements inside OLE objects
Change-Id: I300bb5d3008b839f6ec63a4435f5ce8c1dd0a2c1
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/oox/vml/vmlshape.hxx | 6 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index b0c00b3899b5..728ca15e83b0 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -284,6 +284,12 @@ class RectangleShape : public SimpleShape { public: explicit RectangleShape( Drawing& rDrawing ); +protected: + /** Creates the corresponding XShape and inserts it into the passed container. */ + virtual com::sun::star::uno::Reference<com::sun::star::drawing::XShape> + implConvertAndInsert( + const com::sun::star::uno::Reference<com::sun::star::drawing::XShapes>& rxShapes, + const com::sun::star::awt::Rectangle& rShapeRect) const; }; // ============================================================================ diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 64c0ed71664b..5c8e728e55f2 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -454,6 +454,28 @@ RectangleShape::RectangleShape( Drawing& rDrawing ) : { } +Reference<XShape> RectangleShape::implConvertAndInsert(const Reference<XShapes>& rxShapes, const Rectangle& rShapeRect) const +{ + XmlFilterBase& rFilter = mrDrawing.getFilter(); + OUString aGraphicPath = getGraphicPath(); + + // try to create a picture object + if(!aGraphicPath.isEmpty()) + { + Reference<XShape> xShape = mrDrawing.createAndInsertXShape("com.sun.star.drawing.GraphicObjectShape", rxShapes, rShapeRect); + if (xShape.is()) + { + OUString aGraphicUrl = rFilter.getGraphicHelper().importEmbeddedGraphicObject(aGraphicPath); + PropertySet aPropSet(xShape); + aPropSet.setProperty(PROP_GraphicURL, aGraphicUrl); + } + return xShape; + } + + // default: try to create a rectangle shape + return SimpleShape::implConvertAndInsert(rxShapes, rShapeRect); +} + // ============================================================================ EllipseShape::EllipseShape( Drawing& rDrawing ) : |