Kaydet (Commit) 9f6dd9a4 authored tarafından Miklos Vajna's avatar Miklos Vajna

n#777345 import imagedata of v:rect elements inside OLE objects

Change-Id: I300bb5d3008b839f6ec63a4435f5ce8c1dd0a2c1
üst 2323ca6b
......@@ -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;
};
// ============================================================================
......
......@@ -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 ) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment