25 #include <osl/diagnose.h>
35 template<
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 );
Drawing & mrDrawing
The VML drawing page that contains this shape.
std::shared_ptr< ShapeType > createShapeType()
Creates and returns a new shape template object.
A shape object that is part of a drawing.
const ShapeBase * getShapeById(const OUString &rShapeId) const
Returns the shape with the passed identifier.
void pushMark()
Adds a recursion mark to the stack.
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.
A shape template contains all formatting properties of shapes and can serve as templates for several ...
void popMark()
Removes a recursion mark.
ShapeMap maShapesById
All shape definitions mapped by identifier.
void forEachMem(FuncType pFunc) const
Calls the passed member function of ObjType on every contained object, automatically skips all elemen...
virtual void finalizeFragmentImport()
Final processing after import of the drawing fragment.
DrawingType getType() const
Returns the application type containing the drawing.
const ShapeType * getShapeTypeById(const OUString &rShapeId) const
Returns the shape template with the passed identifier.
ShapeContainer(Drawing &rDrawing)
std::stack< size_t > markStack
Recursion marks from pushMark()/popMark().
Word: One shape per drawing.
void finalizeFragmentImport()
Final processing after import of the drawing fragment.
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()...
mapped_type get(key_type nKey) const
Returns a reference to the object associated to the passed key, or an empty reference on error...
ShapeVector maShapes
All shape definitions.
Represents the collection of VML shapes for a complete draw page.
ShapeTypeMap maTypesById
All shape templates mapped by identifier.
virtual const ShapeBase * getChildById(const OUString &rShapeId) const
Returns the shape with the passed identifier from the child shapes.