LibreOffice Module oox (master) 1
|
Container that holds a list of shapes and shape templates. More...
#include <vmlshapecontainer.hxx>
Public Member Functions | |
ShapeContainer (Drawing &rDrawing) | |
~ShapeContainer () | |
Drawing & | getDrawing () |
Returns the drawing this shape container is part of. More... | |
std::shared_ptr< ShapeType > | createShapeType () |
Creates and returns a new shape template object. More... | |
template<typename ShapeT > | |
std::shared_ptr< ShapeT > | createShape () |
Creates and returns a new shape object of the specified type. More... | |
void | finalizeFragmentImport () |
Final processing after import of the drawing fragment. More... | |
bool | empty () const |
Returns true, if this container does not contain any shapes. More... | |
const ShapeType * | getShapeTypeById (const OUString &rShapeId) const |
Returns the shape template with the passed identifier. More... | |
const ShapeBase * | getShapeById (const OUString &rShapeId) const |
Returns the shape with the passed identifier. More... | |
template<typename Functor > | |
const ShapeBase * | findShape (const Functor &rFunctor) const |
Searches for a shape by using the passed functor that takes a constant reference of a ShapeBase object. More... | |
std::shared_ptr< ShapeBase > | takeLastShape () |
(Word only) Returns the last shape in the collection, if it is after the last mark from pushMark(), and removes it. More... | |
void | pushMark () |
Adds a recursion mark to the stack. More... | |
void | popMark () |
Removes a recursion mark. More... | |
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. More... | |
Private Types | |
typedef RefVector< ShapeType > | ShapeTypeVector |
typedef RefVector< ShapeBase > | ShapeVector |
typedef RefMap< OUString, ShapeType > | ShapeTypeMap |
typedef RefMap< OUString, ShapeBase > | ShapeMap |
Private Attributes | |
Drawing & | mrDrawing |
The VML drawing page that contains this shape. More... | |
ShapeTypeVector | maTypes |
All shape templates. More... | |
ShapeVector | maShapes |
All shape definitions. More... | |
ShapeTypeMap | maTypesById |
All shape templates mapped by identifier. More... | |
ShapeMap | maShapesById |
All shape definitions mapped by identifier. More... | |
std::stack< size_t > | markStack |
Recursion marks from pushMark()/popMark(). More... | |
Container that holds a list of shapes and shape templates.
Definition at line 53 of file vmlshapecontainer.hxx.
|
private |
Definition at line 113 of file vmlshapecontainer.hxx.
|
private |
Definition at line 112 of file vmlshapecontainer.hxx.
|
private |
Definition at line 110 of file vmlshapecontainer.hxx.
|
private |
Definition at line 111 of file vmlshapecontainer.hxx.
|
explicit |
Definition at line 52 of file vmlshapecontainer.cxx.
oox::vml::ShapeContainer::~ShapeContainer | ( | ) |
Definition at line 57 of file vmlshapecontainer.cxx.
void oox::vml::ShapeContainer::convertAndInsert | ( | const css::uno::Reference< css::drawing::XShapes > & | rxShapes, |
const ShapeParentAnchor * | pParentAnchor = nullptr |
||
) | const |
Creates and inserts all UNO shapes into the passed container.
Definition at line 130 of file vmlshapecontainer.cxx.
References maShapes.
std::shared_ptr< ShapeT > oox::vml::ShapeContainer::createShape |
Creates and returns a new shape object of the specified type.
Definition at line 125 of file vmlshapecontainer.hxx.
References maShapes, and mrDrawing.
Referenced by oox::vml::ShapeContextBase::createShapeContext().
std::shared_ptr< ShapeType > oox::vml::ShapeContainer::createShapeType | ( | ) |
Creates and returns a new shape template object.
Definition at line 61 of file vmlshapecontainer.cxx.
References maTypes, and mrDrawing.
Referenced by oox::vml::ShapeContextBase::createShapeContext().
|
inline |
Returns true, if this container does not contain any shapes.
Definition at line 72 of file vmlshapecontainer.hxx.
References maShapes.
void oox::vml::ShapeContainer::finalizeFragmentImport | ( | ) |
Final processing after import of the drawing fragment.
Definition at line 68 of file vmlshapecontainer.cxx.
References oox::vml::ShapeBase::finalizeFragmentImport(), oox::RefVector< ObjType >::forEachMem(), maShapes, maShapesById, maTypes, and maTypesById.
const ShapeBase * oox::vml::ShapeContainer::findShape | ( | const Functor & | rFunctor | ) | const |
Searches for a shape by using the passed functor that takes a constant reference of a ShapeBase object.
Definition at line 134 of file vmlshapecontainer.hxx.
References oox::RefVector< ObjType >::findIf(), and maShapes.
|
inline |
Returns the drawing this shape container is part of.
Definition at line 60 of file vmlshapecontainer.hxx.
References mrDrawing.
Referenced by oox::vml::ControlShapeContext::ControlShapeContext(), and oox::vml::ShapeContextBase::createShapeContext().
const ShapeBase * oox::vml::ShapeContainer::getShapeById | ( | const OUString & | rShapeId | ) | const |
Returns the shape with the passed identifier.
Searches in all group shapes too.
Definition at line 96 of file vmlshapecontainer.cxx.
References oox::RefMap< KeyType, ObjType, CompType >::get(), oox::vml::ShapeBase::getChildById(), maShapes, and maShapesById.
const ShapeType * oox::vml::ShapeContainer::getShapeTypeById | ( | const OUString & | rShapeId | ) | const |
Returns the shape template with the passed identifier.
Searches in all group shapes too.
Definition at line 79 of file vmlshapecontainer.cxx.
References oox::RefMap< KeyType, ObjType, CompType >::get(), maShapes, maTypes, and maTypesById.
Referenced by oox::vml::ShapeBase::finalizeFragmentImport().
void oox::vml::ShapeContainer::popMark | ( | ) |
Removes a recursion mark.
Definition at line 124 of file vmlshapecontainer.cxx.
References markStack.
void oox::vml::ShapeContainer::pushMark | ( | ) |
Adds a recursion mark to the stack.
It is possible that a shape contains <w:txbxContent> which contains another shape, and writerfilter needs to know which shape is from the inner ooxml context and which from the outer ooxml context, while it is necessary to keep at least shape types across such blocks. Therefore this function marks beginning of each shape xml block, and takeLastShape() returns only shapes from this block.
Definition at line 119 of file vmlshapecontainer.cxx.
std::shared_ptr< ShapeBase > oox::vml::ShapeContainer::takeLastShape | ( | ) |
(Word only) Returns the last shape in the collection, if it is after the last mark from pushMark(), and removes it.
Definition at line 108 of file vmlshapecontainer.cxx.
References oox::vml::Drawing::getType(), markStack, maShapes, mrDrawing, and oox::vml::VMLDRAWING_WORD.
|
private |
Recursion marks from pushMark()/popMark().
Definition at line 120 of file vmlshapecontainer.hxx.
Referenced by popMark(), pushMark(), and takeLastShape().
|
private |
All shape definitions.
Definition at line 117 of file vmlshapecontainer.hxx.
Referenced by convertAndInsert(), createShape(), empty(), finalizeFragmentImport(), findShape(), getShapeById(), getShapeTypeById(), pushMark(), and takeLastShape().
|
private |
All shape definitions mapped by identifier.
Definition at line 119 of file vmlshapecontainer.hxx.
Referenced by finalizeFragmentImport(), and getShapeById().
|
private |
All shape templates.
Definition at line 116 of file vmlshapecontainer.hxx.
Referenced by createShapeType(), finalizeFragmentImport(), and getShapeTypeById().
|
private |
All shape templates mapped by identifier.
Definition at line 118 of file vmlshapecontainer.hxx.
Referenced by finalizeFragmentImport(), and getShapeTypeById().
|
private |
The VML drawing page that contains this shape.
Definition at line 115 of file vmlshapecontainer.hxx.
Referenced by createShape(), createShapeType(), getDrawing(), and takeLastShape().