25#include <osl/diagnose.h>
35template<
typename ShapeType >
38 for (
auto const& elem : rVector)
40 const OUString& rShapeId = elem->getShapeId();
41 OSL_ENSURE( !rShapeId.isEmpty(),
"lclMapShapesById - missing shape identifier" );
42 if( !rShapeId.isEmpty() )
44 OSL_ENSURE( orMap.find( rShapeId ) == orMap.end(),
"lclMapShapesById - shape identifier already used " );
45 orMap[ rShapeId ] = elem;
63 auto xShape = std::make_shared<ShapeType>(
mrDrawing );
91 if(
const ShapeType* pType = shape->getChildTypeById( rShapeId ) )
113 return std::shared_ptr< ShapeBase >();
114 std::shared_ptr< ShapeBase > ret =
maShapes.back();
133 shape->convertAndInsert( rxShapes, pParentAnchor );
mapped_type get(key_type nKey) const
Returns a reference to the object associated to the passed key, or an empty reference on error.
void forEachMem(FuncType pFunc) const
Calls the passed member function of ObjType on every contained object, automatically skips all elemen...
Represents the collection of VML shapes for a complete draw page.
DrawingType getType() const
Returns the application type containing the drawing.
A shape object that is part of a drawing.
virtual void finalizeFragmentImport()
Final processing after import of the drawing fragment.
virtual const ShapeBase * getChildById(const OUString &rShapeId) const
Returns the shape with the passed identifier from the child shapes.
ShapeMap maShapesById
All shape definitions mapped by identifier.
const ShapeType * getShapeTypeById(const OUString &rShapeId) const
Returns the shape template with the passed identifier.
Drawing & mrDrawing
The VML drawing page that contains this shape.
ShapeVector maShapes
All shape definitions.
ShapeTypeVector maTypes
All shape templates.
std::shared_ptr< ShapeBase > takeLastShape()
(Word only) Returns the last shape in the collection, if it is after the last mark from pushMark(),...
void convertAndInsert(const css::uno::Reference< css::drawing::XShapes > &rxShapes, const ShapeParentAnchor *pParentAnchor=nullptr) const
Creates and inserts all UNO shapes into the passed container.
ShapeTypeMap maTypesById
All shape templates mapped by identifier.
void finalizeFragmentImport()
Final processing after import of the drawing fragment.
void popMark()
Removes a recursion mark.
std::stack< size_t > markStack
Recursion marks from pushMark()/popMark().
void pushMark()
Adds a recursion mark to the stack.
ShapeContainer(Drawing &rDrawing)
std::shared_ptr< ShapeType > createShapeType()
Creates and returns a new shape template object.
const ShapeBase * getShapeById(const OUString &rShapeId) const
Returns the shape with the passed identifier.
A shape template contains all formatting properties of shapes and can serve as templates for several ...
@ VMLDRAWING_WORD
Word: One shape per drawing.