summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/inc/oox/vml/vmlshape.hxx6
-rw-r--r--oox/source/vml/vmlshape.cxx22
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 ) :