LibreOffice Module oox (master) 1
|
Static helper functions for improved API container handling. More...
#include <containerhelper.hxx>
Static Public Member Functions | |
static OUString | getUnusedName (const css::uno::Reference< css::container::XNameAccess > &rxNameAccess, const OUString &rSuggestedName, sal_Unicode cSeparator) |
Returns a name that is not used in the passed name container. More... | |
static bool | insertByName (const css::uno::Reference< css::container::XNameContainer > &rxNameContainer, const OUString &rName, const css::uno::Any &rObject) |
Inserts an object into a name container. More... | |
static OUString | insertByUnusedName (const css::uno::Reference< css::container::XNameContainer > &rxNameContainer, const OUString &rSuggestedName, sal_Unicode cSeparator, const css::uno::Any &rObject) |
Inserts an object into a name container. More... | |
template<typename VectorType > | |
static const VectorType::value_type * | getVectorElement (const VectorType &rVector, sal_Int32 nIndex) |
Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds. More... | |
template<typename VectorType > | |
static VectorType::value_type * | getVectorElementAccess (VectorType &rVector, sal_Int32 nIndex) |
Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds. More... | |
template<typename VectorType > | |
static const VectorType::value_type & | getVectorElement (const VectorType &rVector, sal_Int32 nIndex, const typename VectorType::value_type &rDefault) |
Returns the reference to an existing element of the passed vector, or the passed default value, if the passed index is out of bounds. More... | |
template<typename MapType > | |
static const MapType::mapped_type * | getMapElement (const MapType &rMap, const typename MapType::key_type &rKey) |
Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist. More... | |
template<typename MapType > | |
static const MapType::mapped_type & | getMapElement (const MapType &rMap, const typename MapType::key_type &rKey, const typename MapType::mapped_type &rDefault) |
Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist. More... | |
template<typename MatrixType > | |
static css::uno::Sequence< css::uno::Sequence< typename MatrixType::value_type > > | matrixToSequenceSequence (const MatrixType &rMatrix) |
Creates a UNO sequence of sequences from a matrix with copies of all elements. More... | |
Static helper functions for improved API container handling.
Definition at line 136 of file containerhelper.hxx.
|
static |
Returns the pointer to an existing element of the passed map, or a null pointer, if an element with the passed key does not exist.
Definition at line 264 of file containerhelper.hxx.
Referenced by oox::vml::Drawing::getControlInfo(), oox::vml::Drawing::getOleObjectInfo(), and oox::core::FastParser::registerNamespace().
|
static |
Returns the reference to an existing element of the passed map, or the passed default value, if an element with the passed key does not exist.
Definition at line 271 of file containerhelper.hxx.
|
static |
Returns a name that is not used in the passed name container.
rxNameAccess | com.sun.star.container.XNameAccess interface of the name container. |
rSuggestedName | Suggested name for the object. |
Definition at line 75 of file containerhelper.cxx.
References nIndex.
Referenced by insertByUnusedName().
|
static |
Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds.
Definition at line 246 of file containerhelper.hxx.
References nIndex.
Referenced by oox::ole::VbaSiteModel::createControlModel().
|
static |
Returns the reference to an existing element of the passed vector, or the passed default value, if the passed index is out of bounds.
Definition at line 258 of file containerhelper.hxx.
References nIndex.
|
static |
Returns the pointer to an existing element of the passed vector, or a null pointer, if the passed index is out of bounds.
Definition at line 252 of file containerhelper.hxx.
References nIndex.
|
static |
Inserts an object into a name container.
rxNameContainer | com.sun.star.container.XNameContainer interface of the name container. |
rName | Exact name for the object. |
rObject | The object to be inserted. |
Definition at line 88 of file containerhelper.cxx.
References Exception.
Referenced by oox::ole::VbaFormControl::createAndConvert(), oox::ole::VbaUserForm::importForm(), insertByUnusedName(), and oox::ObjectContainer::insertObject().
|
static |
Inserts an object into a name container.
The function will use an unused name to insert the object, based on the suggested object name. It is possible to specify whether the existing object or the new inserted object will be renamed, if the container already has an object with the name suggested for the new object.
rxNameContainer | com.sun.star.container.XNameContainer interface of the name container. |
rSuggestedName | Suggested name for the object. |
rObject | The object to be inserted. |
The new object will be inserted with a name not yet extant in the container (this is done by appending a numerical index to the suggested name).
Definition at line 109 of file containerhelper.cxx.
References getUnusedName(), and insertByName().
Referenced by oox::ObjectContainer::insertObject().
|
static |
Creates a UNO sequence of sequences from a matrix with copies of all elements.
rMatrix | The matrix to be converted to a sequence of sequences. |
Definition at line 278 of file containerhelper.hxx.
References aSeq.