[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - chart2/source
Markus Mohrhard (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 27 16:38:40 UTC 2019
chart2/source/inc/OPropertySet.hxx | 2 ++
chart2/source/tools/OPropertySet.cxx | 20 ++++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 7c5dd833e1f62a1cae9ce4ae804146032bd5e841
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
AuthorDate: Wed Aug 28 00:35:03 2019 +0800
Commit: Markus Mohrhard <markus.mohrhard at googlemail.com>
CommitDate: Wed Aug 28 00:35:03 2019 +0800
the default value now needs to come from the style if the style is available
Change-Id: I54b3563aabcde71e7bcddacc8a7a5b1a9eb70ccd
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& )
{
More information about the Libreoffice-commits
mailing list