LibreOffice Module oox (master) 1
|
A wrapper for a UNO property set. More...
#include <propertyset.hxx>
Public Member Functions | |
PropertySet () | |
PropertySet (const css::uno::Reference< css::beans::XPropertySet > &rxPropSet) | |
Constructs a property set wrapper with the passed UNO property set. More... | |
template<typename Type > | |
PropertySet (const Type &rObject) | |
Constructs a property set wrapper after querying the XPropertySet interface. More... | |
void | set (const css::uno::Reference< css::beans::XPropertySet > &rxPropSet) |
Sets the passed UNO property set and releases the old UNO property set. More... | |
template<typename Type > | |
void | set (const Type &rObject) |
Queries the passed object (interface or any) for an XPropertySet and releases the old UNO property set. More... | |
bool | is () const |
Returns true, if the contained XPropertySet interface is valid. More... | |
bool | hasProperty (sal_Int32 nPropId) const |
Returns true, if the specified property is supported by the property set. More... | |
css::uno::Any | getAnyProperty (sal_Int32 nPropId) const |
Gets the specified property from the property set. More... | |
template<typename Type > | |
bool | getProperty (Type &orValue, sal_Int32 nPropId) const |
Gets the specified property from the property set. More... | |
bool | getBoolProperty (sal_Int32 nPropId) const |
Gets the specified boolean property from the property set. More... | |
bool | setAnyProperty (sal_Int32 nPropId, const css::uno::Any &rValue) |
Puts the passed any into the property set. More... | |
template<typename Type > | |
bool | setProperty (sal_Int32 nPropId, const Type &rValue) |
Puts the passed value into the property set. More... | |
bool | setProperty (sal_Int32 nPropId, ::Color rValue) |
void | setProperties (const css::uno::Sequence< OUString > &rPropNames, const css::uno::Sequence< css::uno::Any > &rValues) |
Puts the passed properties into the property set. More... | |
void | setProperties (const PropertyMap &rPropertyMap) |
Puts the passed property map into the property set. More... | |
void | dump () |
Private Member Functions | |
bool | implGetPropertyValue (css::uno::Any &orValue, const OUString &rPropName) const |
Gets the specified property from the property set. More... | |
bool | implSetPropertyValue (const OUString &rPropName, const css::uno::Any &rValue) |
Puts the passed any into the property set. More... | |
Private Attributes | |
css::uno::Reference< css::beans::XPropertySet > | mxPropSet |
The mandatory property set interface. More... | |
css::uno::Reference< css::beans::XMultiPropertySet > | mxMultiPropSet |
The optional multi property set interface. More... | |
css::uno::Reference< css::beans::XPropertySetInfo > | mxPropSetInfo |
Property information. More... | |
A wrapper for a UNO property set.
This class provides functions to silently get and set properties (without exceptions, without the need to check validity of the UNO property set).
An instance is constructed with the reference to a UNO property set or any other interface (the constructor will query for the com.sun.star.beans.XPropertySet interface then). The reference to the property set will be kept as long as the instance of this class is alive.
The functions setProperties() tries to handle all passed values at once, using the com.sun.star.beans.XMultiPropertySet interface. If the implementation does not support the XMultiPropertySet interface, all properties are handled separately in a loop.
Definition at line 57 of file propertyset.hxx.
|
inline |
Definition at line 60 of file propertyset.hxx.
|
inlineexplicit |
Constructs a property set wrapper with the passed UNO property set.
Definition at line 63 of file propertyset.hxx.
References set().
Constructs a property set wrapper after querying the XPropertySet interface.
Definition at line 69 of file propertyset.hxx.
References set().
void oox::PropertySet::dump | ( | ) |
Definition at line 142 of file propertyset.cxx.
References oox::PropertyMap::dump(), and mxPropSet.
Referenced by oox::drawingml::TextParagraphProperties::dump().
Any oox::PropertySet::getAnyProperty | ( | sal_Int32 | nPropId | ) | const |
Gets the specified property from the property set.
Definition at line 62 of file propertyset.cxx.
References Any, oox::PropertyMap::getPropertyName(), and implGetPropertyValue().
Referenced by VbaExport::getLibraryContainer(), oox::ole::VbaProject::getLibraryContainer(), and oox::drawingml::pushToGrabBag().
|
inline |
Gets the specified boolean property from the property set.
Definition at line 99 of file propertyset.hxx.
References getProperty().
Referenced by oox::drawingml::ChartExport::exportLegend(), and oox::drawingml::chart::LegendConverter::legendEntriesFormatting().
|
inline |
Gets the specified property from the property set.
Definition at line 94 of file propertyset.hxx.
Referenced by oox::ole::ControlConverter::bindToSources(), oox::drawingml::chart::UpDownBarsConverter::convertFromModel(), oox::drawingml::chart::AxisConverter::convertFromModel(), oox::drawingml::chart::DataLabelConverter::convertFromModel(), oox::ole::EmbeddedControl::convertFromProperties(), oox::ole::AxFontDataModel::convertFromProperties(), oox::ole::AxCommandButtonModel::convertFromProperties(), oox::ole::AxLabelModel::convertFromProperties(), oox::ole::AxMorphDataModelBase::convertFromProperties(), oox::ole::AxToggleButtonModel::convertFromProperties(), oox::ole::AxCheckBoxModel::convertFromProperties(), oox::ole::AxOptionButtonModel::convertFromProperties(), oox::ole::AxTextBoxModel::convertFromProperties(), oox::ole::AxNumericFieldModel::convertFromProperties(), oox::ole::AxListBoxModel::convertFromProperties(), oox::ole::AxComboBoxModel::convertFromProperties(), oox::ole::AxSpinButtonModel::convertFromProperties(), oox::ole::AxScrollBarModel::convertFromProperties(), oox::ole::ControlConverter::convertToAxBorder(), oox::ole::ControlConverter::convertToAxState(), oox::ole::ControlConverter::convertToAxVisualEffect(), oox::ole::ControlConverter::convertToMSColor(), oox::ole::ControlConverter::convertToMSOrientation(), oox::drawingml::ChartExport::exportLegend(), oox::GraphicHelper::getOriginalSize(), oox::ole::OleFormCtrlExportHelper::OleFormCtrlExportHelper(), and oox::drawingml::TextParagraphProperties::pushToPropSet().
bool oox::PropertySet::hasProperty | ( | sal_Int32 | nPropId | ) | const |
Returns true, if the specified property is supported by the property set.
Definition at line 47 of file propertyset.cxx.
References Exception, oox::PropertyMap::getPropertyName(), and mxPropSetInfo.
Referenced by oox::vml::ShapeBase::convertAndInsert(), and oox::drawingml::pushToGrabBag().
|
private |
Gets the specified property from the property set.
Definition at line 111 of file propertyset.cxx.
References Exception, mxPropSet, and TOOLS_WARN_EXCEPTION.
Referenced by getAnyProperty().
|
private |
Puts the passed any into the property set.
Definition at line 126 of file propertyset.cxx.
References Exception, mxPropSet, and TOOLS_WARN_EXCEPTION.
Referenced by setAnyProperty().
|
inline |
Returns true, if the contained XPropertySet interface is valid.
Definition at line 80 of file propertyset.hxx.
Referenced by oox::drawingml::chart::WallFloorConverter::convertFromModel().
void oox::PropertySet::set | ( | const css::uno::Reference< css::beans::XPropertySet > & | rxPropSet | ) |
Sets the passed UNO property set and releases the old UNO property set.
Referenced by oox::drawingml::chart::WallFloorConverter::convertFromModel().
Queries the passed object (interface or any) for an XPropertySet and releases the old UNO property set.
Definition at line 76 of file propertyset.hxx.
References set().
bool oox::PropertySet::setAnyProperty | ( | sal_Int32 | nPropId, |
const css::uno::Any & | rValue | ||
) |
Puts the passed any into the property set.
Definition at line 70 of file propertyset.cxx.
References oox::PropertyMap::getPropertyName(), and implSetPropertyValue().
Referenced by oox::drawingml::Shape::createAndInsert(), oox::vml::SimpleShape::createPictureObject(), oox::vml::SimpleShape::finalImplConvertAndInsert(), oox::vml::SimpleShape::implConvertAndInsert(), oox::vml::RectangleShape::implConvertAndInsert(), oox::vml::ComplexShape::implConvertAndInsert(), oox::vml::GroupShape::implConvertAndInsert(), oox::drawingml::TextRun::insertAt(), oox::vml::lcl_SetAnchorType(), oox::drawingml::pushToGrabBag(), and oox::drawingml::DrawingML::writeDiagramRels().
void oox::PropertySet::setProperties | ( | const css::uno::Sequence< OUString > & | rPropNames, |
const css::uno::Sequence< css::uno::Any > & | rValues | ||
) |
Puts the passed properties into the property set.
Tries to use the XMultiPropertySet interface.
rPropNames | The property names. MUST be ordered alphabetically. |
rValues | The related property values. |
References dump().
Referenced by oox::ole::EmbeddedControl::convertProperties(), oox::ole::VbaFormControl::convertProperties(), oox::vml::ShapeBase::convertShapeProperties(), oox::drawingml::Shape::createAndInsert(), oox::ppt::SlideFragmentHandler::finalizeImport(), oox::vml::ComplexShape::implConvertAndInsert(), oox::drawingml::TextRun::insertAt(), oox::ppt::SlideFragmentHandler::onCreateContext(), oox::drawingml::TextParagraphProperties::pushToPropSet(), oox::drawingml::TextCharacterProperties::pushToPropSet(), oox::ole::MSConvertOCXControls::ReadOCXStorage(), setProperties(), and oox::ppt::setTextStyle().
void oox::PropertySet::setProperties | ( | const PropertyMap & | rPropertyMap | ) |
Puts the passed property map into the property set.
Tries to use the XMultiPropertySet interface.
rPropertyMap | The property map. |
Definition at line 98 of file propertyset.cxx.
References aPropNames, oox::PropertyMap::empty(), oox::PropertyMap::fillSequences(), and setProperties().
|
inline |
Definition at line 110 of file propertyset.hxx.
|
inline |
Puts the passed value into the property set.
Definition at line 108 of file propertyset.hxx.
Referenced by oox::drawingml::table::applyLineAttributes(), oox::vml::ShapeBase::convertAndInsert(), oox::drawingml::chart::TypeGroupConverter::convertBarGeometry(), oox::drawingml::chart::AxisDispUnitsConverter::convertFromModel(), oox::drawingml::chart::AxisConverter::convertFromModel(), oox::drawingml::chart::ErrorBarConverter::convertFromModel(), oox::drawingml::chart::TrendlineConverter::convertFromModel(), oox::drawingml::chart::DataLabelConverter::convertFromModel(), oox::drawingml::chart::DataLabelsConverter::convertFromModel(), oox::drawingml::chart::LegendConverter::convertFromModel(), oox::drawingml::chart::TypeGroupConverter::convertFromModel(), oox::drawingml::chart::View3DConverter::convertFromModel(), oox::drawingml::chart::ChartSpaceConverter::convertFromModel(), oox::drawingml::chart::DataTableConverter::convertFromModel(), oox::drawingml::chart::LayoutConverter::convertFromModel(), oox::drawingml::chart::TypeGroupConverter::convertLineSmooth(), oox::drawingml::chart::TypeGroupConverter::convertMarker(), oox::drawingml::chart::ObjectFormatter::convertNumberFormat(), oox::drawingml::chart::TypeGroupConverter::convertPieExplosion(), oox::drawingml::chart::TypeGroupConverter::convertPieRotation(), oox::drawingml::chart::ObjectFormatter::convertTextRotation(), oox::drawingml::chart::ObjectFormatter::convertTextWrap(), oox::ppt::SlidePersist::createBackground(), oox::drawingml::chart::TypeGroupConverter::createCoordinateSystem(), oox::drawingml::chart::DataSequenceConverter::createDataSequence(), oox::drawingml::chart::SeriesConverter::createDataSeries(), oox::vml::SimpleShape::createPictureObject(), oox::vml::SimpleShape::finalImplConvertAndInsert(), oox::vml::SimpleShape::implConvertAndInsert(), oox::vml::PolyLineShape::implConvertAndInsert(), oox::vml::BezierShape::implConvertAndInsert(), oox::drawingml::TextRun::insertAt(), oox::drawingml::chart::TypeGroupConverter::insertDataSeries(), oox::vml::lcl_SetAnchorType(), oox::vml::lcl_setSurround(), oox::drawingml::chart::LegendConverter::legendEntriesFormatting(), oox::core::XmlFilterBase::openFragmentStream(), oox::drawingml::TextParagraphProperties::pushToPropSet(), and oox::drawingml::CustomShapeProperties::pushToPropSet().
|
private |
The optional multi property set interface.
Definition at line 141 of file propertyset.hxx.
|
private |
The mandatory property set interface.
Definition at line 139 of file propertyset.hxx.
Referenced by dump(), implGetPropertyValue(), and implSetPropertyValue().
|
private |