LibreOffice Module oox (master)  1
Public Member Functions | Private Types | Private Attributes | List of all members
oox::vml::ShapeContainer Class Reference

Container that holds a list of shapes and shape templates. More...

#include <vmlshapecontainer.hxx>

Collaboration diagram for oox::vml::ShapeContainer:
[legend]

Public Member Functions

 ShapeContainer (Drawing &rDrawing)
 
 ~ShapeContainer ()
 
DrawinggetDrawing ()
 Returns the drawing this shape container is part of. More...
 
std::shared_ptr< ShapeTypecreateShapeType ()
 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 ShapeTypegetShapeTypeById (const OUString &rShapeId) const
 Returns the shape template with the passed identifier. More...
 
const ShapeBasegetShapeById (const OUString &rShapeId) const
 Returns the shape with the passed identifier. More...
 
template<typename Functor >
const ShapeBasefindShape (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< ShapeBasetakeLastShape ()
 (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< ShapeTypeShapeTypeVector
 
typedef RefVector< ShapeBaseShapeVector
 
typedef RefMap< OUString, ShapeTypeShapeTypeMap
 
typedef RefMap< OUString, ShapeBaseShapeMap
 

Private Attributes

DrawingmrDrawing
 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...
 

Detailed Description

Container that holds a list of shapes and shape templates.

Definition at line 53 of file vmlshapecontainer.hxx.

Member Typedef Documentation

typedef RefMap< OUString, ShapeBase > oox::vml::ShapeContainer::ShapeMap
private

Definition at line 113 of file vmlshapecontainer.hxx.

Definition at line 112 of file vmlshapecontainer.hxx.

Definition at line 110 of file vmlshapecontainer.hxx.

Definition at line 111 of file vmlshapecontainer.hxx.

Constructor & Destructor Documentation

oox::vml::ShapeContainer::ShapeContainer ( Drawing rDrawing)
explicit

Definition at line 52 of file vmlshapecontainer.cxx.

oox::vml::ShapeContainer::~ShapeContainer ( )

Definition at line 57 of file vmlshapecontainer.cxx.

Member Function Documentation

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.

template<typename ShapeT >
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().

bool oox::vml::ShapeContainer::empty ( ) const
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.

template<typename Functor >
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.

Drawing& oox::vml::ShapeContainer::getDrawing ( )
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.

References markStack, and maShapes.

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.

Member Data Documentation

std::stack< size_t > oox::vml::ShapeContainer::markStack
private

Recursion marks from pushMark()/popMark().

Definition at line 120 of file vmlshapecontainer.hxx.

Referenced by popMark(), pushMark(), and takeLastShape().

ShapeVector oox::vml::ShapeContainer::maShapes
private
ShapeMap oox::vml::ShapeContainer::maShapesById
private

All shape definitions mapped by identifier.

Definition at line 119 of file vmlshapecontainer.hxx.

Referenced by finalizeFragmentImport(), and getShapeById().

ShapeTypeVector oox::vml::ShapeContainer::maTypes
private

All shape templates.

Definition at line 116 of file vmlshapecontainer.hxx.

Referenced by createShapeType(), finalizeFragmentImport(), and getShapeTypeById().

ShapeTypeMap oox::vml::ShapeContainer::maTypesById
private

All shape templates mapped by identifier.

Definition at line 118 of file vmlshapecontainer.hxx.

Referenced by finalizeFragmentImport(), and getShapeTypeById().

Drawing& oox::vml::ShapeContainer::mrDrawing
private

The VML drawing page that contains this shape.

Definition at line 115 of file vmlshapecontainer.hxx.

Referenced by createShape(), createShapeType(), getDrawing(), and takeLastShape().


The documentation for this class was generated from the following files: