diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-28 00:35:03 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-28 00:35:03 +0800 |
commit | 7c5dd833e1f62a1cae9ce4ae804146032bd5e841 (patch) | |
tree | 5e1d2717c050d0710e232884a13a1282f33c98a5 | |
parent | move default values from hard formatting to style (diff) | |
download | core-feature/chart-style-experiment-markus.tar.gz core-feature/chart-style-experiment-markus.zip |
the default value now needs to come from the style if the style is available
feature/chart-style-experiment-markus
Change-Id: I54b3563aabcde71e7bcddacc8a7a5b1a9eb70ccd
-rw-r--r-- | chart2/source/inc/OPropertySet.hxx | 2 | ||||
-rw-r--r-- | chart2/source/tools/OPropertySet.cxx | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/chart2/source/inc/OPropertySet.hxx b/chart2/source/inc/OPropertySet.hxx index 12a55c677661..50e40b9fa082 100644 --- a/chart2/source/inc/OPropertySet.hxx +++ b/chart2/source/inc/OPropertySet.hxx @@ -69,6 +69,8 @@ protected: */ virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const = 0; + css::uno::Any GetDefault(sal_Int32 nHandle) const; + /** The InfoHelper table contains all property names and types of this object. diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index fe4c69700fad..33ed2bcb0a53 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -105,6 +105,18 @@ Sequence< sal_Int8 > SAL_CALL return css::uno::Sequence<sal_Int8>(); } +Any OPropertySet::GetDefault(sal_Int32 nHandle) const +{ + Reference<style::XStyle> xStyle = m_pImplProperties->GetStyle(); + if (xStyle.is()) + { + css::uno::Reference<css::beans::XFastPropertySet> xStylePropSet(xStyle, css::uno::UNO_QUERY); + return xStylePropSet->getFastPropertyValue(nHandle); + } + + return GetDefaultValue(nHandle); +} + // ____ XPropertyState ____ beans::PropertyState SAL_CALL OPropertySet::getPropertyState( const OUString& PropertyName ) @@ -143,7 +155,7 @@ Any SAL_CALL { cppu::IPropertyArrayHelper & rPH = getInfoHelper(); - return GetDefaultValue( rPH.getHandleByName( aPropertyName ) ); + return GetDefault( rPH.getHandleByName( aPropertyName ) ); } // ____ XMultiPropertyStates ____ @@ -184,7 +196,7 @@ Sequence< Any > SAL_CALL for( ; nI < nElements; ++nI ) { - pResultArray[ nI ] = GetDefaultValue( + pResultArray[ nI ] = GetDefault( rPH.getHandleByName( aPropertyNames[ nI ] )); } @@ -242,7 +254,7 @@ void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast Any aDefault; try { - aDefault = GetDefaultValue( nHandle ); + aDefault = GetDefault( nHandle ); } catch( const beans::UnknownPropertyException& ) { @@ -322,7 +334,7 @@ void SAL_CALL OPropertySet::getFastPropertyValue // => take the default value try { - rValue = GetDefaultValue( nHandle ); + rValue = GetDefault( nHandle ); } catch( const beans::UnknownPropertyException& ) { |