LibreOffice Module sc (master) 1
|
A wrapper for a UNO property set. More...
#include <fapihelper.hxx>
Public Member Functions | |
ScfPropertySet () | |
ScfPropertySet (const css::uno::Reference< css::beans::XPropertySet > &xPropSet) | |
Constructs a property set wrapper with the passed UNO property set. More... | |
template<typename InterfaceType > | |
ScfPropertySet (const css::uno::Reference< InterfaceType > &xInterface) | |
Constructs a property set wrapper after querying the XPropertySet interface. More... | |
~ScfPropertySet () | |
ScfPropertySet (ScfPropertySet const &)=default | |
ScfPropertySet (ScfPropertySet &&)=default | |
ScfPropertySet & | operator= (ScfPropertySet const &)=default |
ScfPropertySet & | operator= (ScfPropertySet &&)=default |
void | Set (css::uno::Reference< css::beans::XPropertySet > const &xPropSet) |
Sets the passed UNO property set and releases the old UNO property set. More... | |
template<typename InterfaceType > | |
void | Set (css::uno::Reference< InterfaceType > xInterface) |
Queries the passed interface for an XPropertySet and releases the old UNO property set. More... | |
bool | Is () const |
Returns true, if the contained XPropertySet interface is valid. More... | |
const css::uno::Reference< css::beans::XPropertySet > & | GetApiPropertySet () const |
Returns the contained XPropertySet interface. More... | |
OUString | GetServiceName () const |
Returns the service name provided via the XServiceName interface, or an empty string on error. More... | |
bool | HasProperty (const OUString &rPropName) const |
Returns true, if the property set contains the specified property. More... | |
bool | GetAnyProperty (css::uno::Any &rValue, const OUString &rPropName) const |
Gets the specified property from the property set. More... | |
template<typename Type > | |
bool | GetProperty (Type &rValue, const OUString &rPropName) const |
Gets the specified property from the property set. More... | |
bool | GetBoolProperty (const OUString &rPropName) const |
Gets the specified Boolean property from the property set. More... | |
OUString | GetStringProperty (const OUString &rPropName) const |
Gets the specified Boolean property from the property set. More... | |
bool | GetColorProperty (Color &rColor, const OUString &rPropName) const |
Gets the specified color property from the property set. More... | |
void | GetProperties (css::uno::Sequence< css::uno::Any > &rValues, const css::uno::Sequence< OUString > &rPropNames) const |
Gets the specified properties from the property set. More... | |
void | SetAnyProperty (const OUString &rPropName, const css::uno::Any &rValue) |
Puts the passed Any into the property set. More... | |
template<typename Type > | |
void | SetProperty (const OUString &rPropName, const Type &rValue) |
Puts the passed value into the property set. More... | |
void | SetBoolProperty (const OUString &rPropName, bool bValue) |
Puts the passed Boolean value into the property set. More... | |
void | SetStringProperty (const OUString &rPropName, const OUString &rValue) |
Puts the passed string into the property set. More... | |
void | SetColorProperty (const OUString &rPropName, const Color &rColor) |
Puts the passed color into the property set. More... | |
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... | |
Private Attributes | |
css::uno::Reference< css::beans::XPropertySet > | mxPropSet |
css::uno::Reference< css::beans::XMultiPropertySet > | mxMultiPropSet |
The mandatory property set interface. 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 XPropertySet interface then). The reference to the property set will be kept as long as the instance of this class is alive.
The functions GetProperties() and SetProperties() try to handle all passed values at once, using the XMultiPropertySet interface. If the implementation does not support the XMultiPropertySet interface, all properties are handled separately in a loop.
Definition at line 103 of file fapihelper.hxx.
|
inlineexplicit |
Definition at line 106 of file fapihelper.hxx.
|
inlineexplicit |
Constructs a property set wrapper with the passed UNO property set.
Definition at line 108 of file fapihelper.hxx.
References Set().
|
inlineexplicit |
Constructs a property set wrapper after querying the XPropertySet interface.
Definition at line 111 of file fapihelper.hxx.
References Set().
ScfPropertySet::~ScfPropertySet | ( | ) |
Definition at line 131 of file fapihelper.cxx.
References mxPropSet.
|
default |
|
default |
bool ScfPropertySet::GetAnyProperty | ( | css::uno::Any & | rValue, |
const OUString & | rPropName | ||
) | const |
Gets the specified property from the property set.
Definition at line 171 of file fapihelper.cxx.
References Exception, and mxPropSet.
Referenced by XclExpChLegend::Convert(), XclExpChText::ConvertTitle(), GetBoolProperty(), and GetProperty().
|
inline |
Returns the contained XPropertySet interface.
Definition at line 131 of file fapihelper.hxx.
References mxPropSet.
Referenced by XclExpChSerErrorBar::Convert().
bool ScfPropertySet::GetBoolProperty | ( | const OUString & | rPropName | ) | const |
Gets the specified Boolean property from the property set.
Definition at line 188 of file fapihelper.cxx.
References Any, GetAnyProperty(), and ScUnoHelpFunctions::GetBoolFromAny().
Referenced by XclExpChChart3d::Convert(), XclExpChTick::Convert(), XclExpChAxis::Convert(), XclExpChType::Convert(), XclExpChAxesSet::Convert(), XclExpChSerTrendLine::Convert(), XclExpChTypeGroup::ConvertLegend(), XclExpChTypeGroup::ConvertSeries(), XclExpChTypeGroup::CreateAllStockSeries(), XclExpChSeries::CreateErrorBar(), XclChPropSetHelper::ReadRotationProperties(), XclExpChChart::XclExpChChart(), XclExpOcxControlObj::XclExpOcxControlObj(), and XclExpTbxControlObj::XclExpTbxControlObj().
bool ScfPropertySet::GetColorProperty | ( | Color & | rColor, |
const OUString & | rPropName | ||
) | const |
Gets the specified color property from the property set.
Definition at line 201 of file fapihelper.cxx.
References ColorTransparency, and GetProperty().
Referenced by XclExpChMarkerFormat::Convert(), and XclExpChMarkerFormat::ConvertStockSymbol().
void ScfPropertySet::GetProperties | ( | css::uno::Sequence< css::uno::Any > & | rValues, |
const css::uno::Sequence< OUString > & | rPropNames | ||
) | const |
Gets the specified properties from the property set.
Tries to use the XMultiPropertySet interface.
rPropNames | The property names. MUST be ordered alphabetically. |
rValues | The related property values. |
Definition at line 209 of file fapihelper.cxx.
References Any, Exception, mxMultiPropSet, and mxPropSet.
Referenced by ScfPropSetHelper::ReadFromPropertySet().
|
inline |
Gets the specified property from the property set.
Definition at line 148 of file fapihelper.hxx.
References GetAnyProperty().
Referenced by XclExpChLabelRange::Convert(), XclExpChPieFormat::Convert(), XclExpCh3dDataFormat::Convert(), XclExpChLegend::Convert(), XclExpChChart3d::Convert(), XclExpChTick::Convert(), XclExpChAxis::Convert(), XclExpChType::Convert(), XclExpChSerTrendLine::Convert(), XclExpChSerErrorBar::Convert(), XclExpChLabelRange::ConvertAxisPosition(), XclExpChValueRange::ConvertAxisPosition(), XclExpChText::ConvertDataLabel(), XclImpChText::ConvertDataLabel(), XclExpChSeries::ConvertDataSeries(), XclExpChSourceLink::ConvertNumFmt(), XclExpChRoot::ConvertPieRotation(), XclExpChTypeGroup::ConvertSeries(), XclExpControlHelper::ConvertSheetLinks(), XclExpChSeries::ConvertStockSeries(), XclExpChTypeGroup::ConvertType(), XclExpChTypeGroup::CreateAllStockSeries(), XclExpChSeries::CreateErrorBars(), XclImpChTypeGroup::CreateStockSeries(), GetColorProperty(), GetStringProperty(), XclChPropSetHelper::ReadMarkerProperties(), XclChPropSetHelper::ReadRotationProperties(), XclExpChartDrawing::XclExpChartDrawing(), XclExpChartObj::XclExpChartObj(), XclExpChChart::XclExpChChart(), XclExpOcxControlObj::XclExpOcxControlObj(), XclExpTbxControlObj::XclExpTbxControlObj(), and XclExpWebQueryBuffer::XclExpWebQueryBuffer().
OUString ScfPropertySet::GetServiceName | ( | ) | const |
Returns the service name provided via the XServiceName interface, or an empty string on error.
Definition at line 150 of file fapihelper.cxx.
References ScfApiHelper::GetServiceName(), and mxPropSet.
Referenced by XclExpChSerTrendLine::Convert().
OUString ScfPropertySet::GetStringProperty | ( | const OUString & | rPropName | ) | const |
Gets the specified Boolean property from the property set.
Definition at line 194 of file fapihelper.cxx.
References GetProperty().
Referenced by XclExpChFrLabelProps::Convert().
bool ScfPropertySet::HasProperty | ( | const OUString & | rPropName | ) | const |
Returns true, if the property set contains the specified property.
Definition at line 157 of file fapihelper.cxx.
References Exception, and mxPropSet.
Referenced by XclExpChSeries::ConvertDataSeries().
|
inline |
Returns true, if the contained XPropertySet interface is valid.
Definition at line 128 of file fapihelper.hxx.
References mxPropSet.
Referenced by XclExpChDropBar::Convert(), XclExpChAxis::Convert(), XclExpTbxControlObj::XclExpTbxControlObj(), and XclExpWebQueryBuffer::XclExpWebQueryBuffer().
|
default |
|
default |
void ScfPropertySet::Set | ( | css::uno::Reference< css::beans::XPropertySet > const & | xPropSet | ) |
Sets the passed UNO property set and releases the old UNO property set.
Referenced by ScfPropertySet(), and Set().
|
inline |
Queries the passed interface for an XPropertySet and releases the old UNO property set.
Definition at line 124 of file fapihelper.hxx.
References Set().
void ScfPropertySet::SetAnyProperty | ( | const OUString & | rPropName, |
const css::uno::Any & | rValue | ||
) |
Puts the passed Any into the property set.
Definition at line 233 of file fapihelper.cxx.
References Exception, mxPropSet, and SAL_WARN.
Referenced by XclImpChSourceLink::ConvertNumFmt(), SetBoolProperty(), and SetProperty().
|
inline |
Puts the passed Boolean value into the property set.
Definition at line 178 of file fapihelper.hxx.
References SetAnyProperty().
Referenced by XclImpChChart::Convert(), XclImpChChart3d::Convert(), XclImpChLabelRange::Convert(), XclImpChAxis::CreateAxis(), XclImpChType::CreateChartType(), XclImpChTypeGroup::CreateChartType(), XclImpChType::CreateCoordSystem(), XclImpChSeries::CreateDataSeries(), XclImpChSerErrorBar::CreateErrorBar(), XclImpChLegend::CreateLegend(), XclImpChSerTrendLine::CreateRegressionCurve(), XclImpChTypeGroup::CreateStockSeries(), XclImpButtonObj::DoProcessControl(), XclImpCheckBoxObj::DoProcessControl(), XclImpLabelObj::DoProcessControl(), XclImpEditObj::DoProcessControl(), XclImpListBoxObj::DoProcessControl(), XclImpDropDownObj::DoProcessControl(), and XclImpControlHelper::ProcessControl().
|
inline |
Puts the passed color into the property set.
Definition at line 186 of file fapihelper.hxx.
References SetProperty().
Referenced by XclImpChChart3d::Convert(), and XclImpChMarkerFormat::ConvertColor().
void ScfPropertySet::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. |
Definition at line 246 of file fapihelper.cxx.
References Any, Exception, mxMultiPropSet, and mxPropSet.
Referenced by ScfPropSetHelper::WriteToPropertySet().
|
inline |
Puts the passed value into the property set.
Definition at line 174 of file fapihelper.hxx.
References SetAnyProperty().
Referenced by XclImpChPieFormat::Convert(), XclImpCh3dDataFormat::Convert(), XclImpChTick::Convert(), XclImpChChart3d::Convert(), XclImpChDataFormat::Convert(), XclImpChLabelRange::Convert(), XclImpChValueRange::ConvertAxisPosition(), XclImpChLabelRange::ConvertAxisPosition(), XclImpChText::ConvertDataLabel(), XclExpChSeries::ConvertDataSeries(), XclImpChSourceLink::ConvertNumFmt(), XclImpChRoot::ConvertPieRotation(), XclImpChAxis::CreateAxis(), XclImpChType::CreateChartType(), XclImpChSourceLink::CreateDataSequence(), XclImpChSeries::CreateDataSeries(), XclImpChTypeGroup::CreateDataSeries(), XclImpChChart::CreateDiagram(), XclImpChSerErrorBar::CreateErrorBar(), XclImpChLegend::CreateLegend(), XclImpChSerTrendLine::CreateRegressionCurve(), XclImpButtonObj::DoProcessControl(), XclImpCheckBoxObj::DoProcessControl(), XclImpLabelObj::DoProcessControl(), XclImpEditObj::DoProcessControl(), XclImpSpinButtonObj::DoProcessControl(), XclImpScrollBarObj::DoProcessControl(), XclImpListBoxObj::DoProcessControl(), XclImpDropDownObj::DoProcessControl(), XclImpChTypeGroup::InsertDataSeries(), XclImpTbxObjListBase::SetBoxFormatting(), SetColorProperty(), SetStringProperty(), XclChPropSetHelper::WriteMarkerProperties(), and XclChPropSetHelper::WriteRotationProperties().
|
inline |
Puts the passed string into the property set.
Definition at line 182 of file fapihelper.hxx.
References SetProperty().
Referenced by XclImpChText::ConvertDataLabel(), XclImpTbxObjBase::ConvertLabel(), XclImpDffConverter::CreateSdrObject(), XclImpOptionButtonObj::DoProcessControl(), XclImpDropDownObj::DoProcessControl(), XclImpControlHelper::ProcessControl(), and XclImpControlHelper::SetStringProperty().
|
private |
The mandatory property set interface.
Definition at line 196 of file fapihelper.hxx.
Referenced by GetProperties(), and SetProperties().
|
private |
Definition at line 195 of file fapihelper.hxx.
Referenced by GetAnyProperty(), GetApiPropertySet(), GetProperties(), GetServiceName(), HasProperty(), Is(), SetAnyProperty(), SetProperties(), and ~ScfPropertySet().