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

A helper that maps property identifiers to property values. More...

#include <propertymap.hxx>

Inheritance diagram for oox::PropertyMap:
[legend]

Public Member Functions

 PropertyMap ()
 
bool hasProperty (sal_Int32 nPropId) const
 Returns true, if the map contains a property with the passed identifier. More...
 
bool setAnyProperty (sal_Int32 nPropId, const css::uno::Any &rValue)
 Sets the specified property to the passed value. More...
 
template<typename Type >
bool setProperty (sal_Int32 nPropId, Type &&rValue)
 Sets the specified property to the passed value. More...
 
bool setProperty (sal_Int32, const css::uno::Any &)=delete
 setAnyProperty should be used More...
 
css::uno::Any getProperty (sal_Int32 nPropId)
 
void erase (sal_Int32 nPropId)
 
bool empty () const
 
void assignUsed (const PropertyMap &rPropMap)
 Inserts all properties contained in the passed property map. More...
 
void assignAll (const PropertyMap &rPropMap)
 Inserts all properties contained in the passed property map. More...
 
css::uno::Sequence< css::beans::PropertyValue > makePropertyValueSequence () const
 Returns a sequence of property values, filled with all contained properties. More...
 
void fillSequences (css::uno::Sequence< OUString > &rNames, css::uno::Sequence< css::uno::Any > &rValues) const
 Fills the passed sequences of names and anys with all contained properties. More...
 
void fillPropertyNameMap (PropertyNameMap &rMap) const
 
css::uno::Reference< css::beans::XPropertySetmakePropertySet () const
 Creates a property set supporting the XPropertySet interface and inserts all properties. More...
 

Static Public Member Functions

static const OUString & getPropertyName (sal_Int32 nPropId)
 Returns the name of the passed property identifier. More...
 
static sal_Int32 getPropertyId (std::u16string_view sPropName)
 Returns the property identifier of the passed name. More...
 
static void dump (const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
 
static void dumpCode (const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
 
static void dumpData (const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
 

Private Attributes

const std::vector< OUString > * mpPropNames
 
std::map< sal_Int32, css::uno::Any > maProperties
 

Detailed Description

A helper that maps property identifiers to property values.

The property identifiers are generated on compile time and refer to the property name strings that are held by a static vector. The identifier to name mapping is done internally while the properties are written to property sets.

Definition at line 51 of file propertymap.hxx.

Constructor & Destructor Documentation

◆ PropertyMap()

oox::PropertyMap::PropertyMap ( )

Definition at line 179 of file propertymap.cxx.

Member Function Documentation

◆ assignAll()

void oox::PropertyMap::assignAll ( const PropertyMap rPropMap)

Inserts all properties contained in the passed property map.

Definition at line 240 of file propertymap.cxx.

References maProperties.

Referenced by oox::drawingml::TextParagraphProperties::apply().

◆ assignUsed()

void oox::PropertyMap::assignUsed ( const PropertyMap rPropMap)

Inserts all properties contained in the passed property map.

Definition at line 213 of file propertymap.cxx.

References maProperties.

Referenced by oox::drawingml::TextCharacterProperties::assignUsed(), and oox::drawingml::Shape::createAndInsert().

◆ dump()

void oox::PropertyMap::dump ( const css::uno::Reference< css::beans::XPropertySet > &  rXPropSet)
static

◆ dumpCode()

void oox::PropertyMap::dumpCode ( const css::uno::Reference< css::beans::XPropertySet > &  rXPropSet)
static

◆ dumpData()

void oox::PropertyMap::dumpData ( const css::uno::Reference< css::beans::XPropertySet > &  rXPropSet)
static

◆ empty()

bool oox::PropertyMap::empty ( ) const

◆ erase()

void oox::PropertyMap::erase ( sal_Int32  nPropId)

◆ fillPropertyNameMap()

void oox::PropertyMap::fillPropertyNameMap ( PropertyNameMap rMap) const

Definition at line 280 of file propertymap.cxx.

References maProperties, and mpPropNames.

Referenced by oox::drawingml::ShapePropertyMap::setAnyProperty().

◆ fillSequences()

void oox::PropertyMap::fillSequences ( css::uno::Sequence< OUString > &  rNames,
css::uno::Sequence< css::uno::Any > &  rValues 
) const

Fills the passed sequences of names and anys with all contained properties.

Definition at line 261 of file propertymap.cxx.

References Any, maProperties, and pValues.

Referenced by oox::PropertySet::setProperties().

◆ getProperty()

Any oox::PropertyMap::getProperty ( sal_Int32  nPropId)

◆ getPropertyId()

sal_Int32 oox::PropertyMap::getPropertyId ( std::u16string_view  sPropName)
static

Returns the property identifier of the passed name.

Definition at line 224 of file propertymap.cxx.

References a, and oox::GetPropertyNameVector().

Referenced by oox::drawingml::DiagramData::restoreDataFromModelToShapeAfterReCreation().

◆ getPropertyName()

const OUString & oox::PropertyMap::getPropertyName ( sal_Int32  nPropId)
static

◆ hasProperty()

bool oox::PropertyMap::hasProperty ( sal_Int32  nPropId) const

◆ makePropertySet()

Reference< XPropertySet > oox::PropertyMap::makePropertySet ( ) const

Creates a property set supporting the XPropertySet interface and inserts all properties.

Definition at line 288 of file propertymap.cxx.

Referenced by oox::ppt::SlidePersist::createBackground(), and oox::drawingml::CustomShapeProperties::pushToPropSet().

◆ makePropertyValueSequence()

Sequence< PropertyValue > oox::PropertyMap::makePropertyValueSequence ( ) const

Returns a sequence of property values, filled with all contained properties.

Definition at line 246 of file propertymap.cxx.

References aSeq, maProperties, and pValues.

Referenced by oox::drawingml::lcl_copyCharPropsToShape(), oox::drawingml::TextParagraphProperties::pushToPropSet(), and oox::drawingml::CustomShapeProperties::pushToPropSet().

◆ setAnyProperty()

bool oox::PropertyMap::setAnyProperty ( sal_Int32  nPropId,
const css::uno::Any &  rValue 
)

Sets the specified property to the passed value.

Does nothing, if the identifier is invalid.

Definition at line 189 of file propertymap.cxx.

References maProperties.

Referenced by oox::drawingml::BulletList::pushToPropMap(), and oox::drawingml::DiagramData::restoreDataFromModelToShapeAfterReCreation().

◆ setProperty() [1/2]

template<typename Type >
bool oox::PropertyMap::setProperty ( sal_Int32  nPropId,
Type &&  rValue 
)
inline

Sets the specified property to the passed value.

Does nothing, if the identifier is invalid.

Definition at line 72 of file propertymap.hxx.

References maProperties.

Referenced by oox::drawingml::TextBody::ApplyStyleEmpty(), oox::ole::ControlConverter::convertAxBorder(), oox::ole::ControlConverter::convertAxPicture(), oox::ole::ControlConverter::convertAxState(), oox::ole::ControlConverter::convertAxVisualEffect(), oox::ole::ControlConverter::convertColor(), oox::ole::ControlConverter::convertOrientation(), oox::ole::ControlConverter::convertPicture(), oox::ole::ControlConverter::convertPosition(), oox::ole::EmbeddedControl::convertProperties(), oox::ole::ComCtlModelBase::convertProperties(), oox::ole::ComCtlScrollBarModel::convertProperties(), oox::ole::ComCtlProgressBarModel::convertProperties(), oox::ole::AxFontDataModel::convertProperties(), oox::ole::AxCommandButtonModel::convertProperties(), oox::ole::AxLabelModel::convertProperties(), oox::ole::AxImageModel::convertProperties(), oox::ole::AxMorphDataModelBase::convertProperties(), oox::ole::AxToggleButtonModel::convertProperties(), oox::ole::AxCheckBoxModel::convertProperties(), oox::ole::AxOptionButtonModel::convertProperties(), oox::ole::AxTextBoxModel::convertProperties(), oox::ole::AxNumericFieldModel::convertProperties(), oox::ole::AxListBoxModel::convertProperties(), oox::ole::AxComboBoxModel::convertProperties(), oox::ole::AxSpinButtonModel::convertProperties(), oox::ole::AxScrollBarModel::convertProperties(), oox::ole::AxFrameModel::convertProperties(), oox::ole::AxPageModel::convertProperties(), oox::ole::AxMultiPageModel::convertProperties(), oox::ole::AxUserFormModel::convertProperties(), oox::ole::HtmlSelectModel::convertProperties(), oox::ole::VbaSiteModel::convertProperties(), oox::ole::ControlConverter::convertScrollabilitySettings(), oox::ole::ControlConverter::convertScrollBar(), oox::ole::ControlConverter::convertSize(), oox::ole::ControlConverter::convertVerticalAlign(), oox::drawingml::Shape::createAndInsert(), oox::drawingml::Shape::finalizeServiceName(), oox::drawingml::HyperLinkContext::HyperLinkContext(), oox::vml::ComplexShape::implConvertAndInsert(), oox::ole::OleObjectHelper::importOleObject(), oox::drawingml::CustomShapeProperties::initializePresetDataMap(), oox::drawingml::TextParagraph::insertAt(), oox::ppt::PPTShapePropertiesContext::onCreateContext(), oox::drawingml::HyperLinkContext::onCreateContext(), oox::ppt::SlideFragmentHandler::onCreateContext(), oox::ppt::SoundActionContext::onEndElement(), oox::drawingml::TextBodyProperties::pushTextDistances(), oox::drawingml::BulletList::pushToPropMap(), oox::drawingml::TextCharacterProperties::pushToPropMap(), oox::drawingml::EffectProperties::pushToPropMap(), oox::drawingml::GraphicProperties::pushToPropMap(), oox::drawingml::TextParagraphProperties::pushToPropSet(), oox::drawingml::CustomShapeProperties::pushToPropSet(), oox::drawingml::TextBodyProperties::pushVertSimulation(), oox::ole::MSConvertOCXControls::ReadOCXStorage(), oox::drawingml::Shape::setDefaults(), oox::ppt::SlideTransition::setSlideProperties(), oox::drawingml::TextParagraphPropertiesContext::TextParagraphPropertiesContext(), and oox::drawingml::TextParagraphPropertiesContext::~TextParagraphPropertiesContext().

◆ setProperty() [2/2]

bool oox::PropertyMap::setProperty ( sal_Int32  ,
const css::uno::Any &   
)
delete

setAnyProperty should be used

References dump(), and getProperty().

Member Data Documentation

◆ maProperties

std::map< sal_Int32, css::uno::Any > oox::PropertyMap::maProperties
private

◆ mpPropNames

const std::vector<OUString>* oox::PropertyMap::mpPropNames
private

Definition at line 119 of file propertymap.hxx.

Referenced by fillPropertyNameMap().


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