diff options
Diffstat (limited to 'chart2/source/tools/OPropertySet.cxx')
-rw-r--r-- | chart2/source/tools/OPropertySet.cxx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index d3988bb93671..4ba7f99edcc1 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -63,7 +63,8 @@ OPropertySet::OPropertySet( ::osl::Mutex & par_rMutex ) : // the following causes a warning; there seems to be no way to avoid it OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )), m_rMutex( par_rMutex ), - m_pImplProperties( new impl::ImplOPropertySet() ) + m_pImplProperties( new impl::ImplOPropertySet() ), + m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false) { } @@ -71,7 +72,8 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut OBroadcastHelper( par_rMutex ), // the following causes a warning; there seems to be no way to avoid it OPropertySetHelper( static_cast< OBroadcastHelper & >( *this )), - m_rMutex( par_rMutex ) + m_rMutex( par_rMutex ), + m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault(false) { // /-- MutexGuard aGuard( m_rMutex ); @@ -80,6 +82,11 @@ OPropertySet::OPropertySet( const OPropertySet & rOther, ::osl::Mutex & par_rMut // \-- } +void OPropertySet::SetNewValuesExplicitlyEvenIfTheyEqualDefault() +{ + m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault = true; +} + OPropertySet::~OPropertySet() {} @@ -322,6 +329,8 @@ sal_Bool SAL_CALL OPropertySet::convertFastPropertyValue } } rConvertedValue = rValue; + if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && rOldValue == rConvertedValue ) + return sal_False;//no change necessary return sal_True; } @@ -341,7 +350,20 @@ void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast } #endif + Any aDefault; + try + { + aDefault = GetDefaultValue( nHandle ); + } + catch( beans::UnknownPropertyException ex ) + { + aDefault.clear(); + } m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue ); + if( !m_bSetNewValuesExplicitlyEvenIfTheyEqualDefault && aDefault.hasValue() && aDefault == rValue ) //#i98893# don't export defaults to file + m_pImplProperties->SetPropertyToDefault( nHandle ); + else + m_pImplProperties->SetPropertyValueByHandle( nHandle, rValue ); } void SAL_CALL OPropertySet::getFastPropertyValue |