diff options
Diffstat (limited to 'xmloff/source/forms/gridcolumnproptranslator.cxx')
-rw-r--r-- | xmloff/source/forms/gridcolumnproptranslator.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx index 766c2dd2483f..7e2476e6f054 100644 --- a/xmloff/source/forms/gridcolumnproptranslator.cxx +++ b/xmloff/source/forms/gridcolumnproptranslator.cxx @@ -235,9 +235,15 @@ namespace xmloff } //-------------------------------------------------------------------- - void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) + void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - Sequence< ::rtl::OUString > aNames( &aPropertyName, 1 ); + // we implement this by delegating it to setPropertyValues, which is to ignore unknown properties. On the other hand, our + // contract requires us to throw a UnknownPropertyException for unknown properties, so check this first. + + if ( !getPropertySetInfo()->hasPropertyByName( _rPropertyName ) ) + throw UnknownPropertyException( _rPropertyName, *this ); + + Sequence< ::rtl::OUString > aNames( &_rPropertyName, 1 ); Sequence< Any > aValues( &aValue, 1 ); setPropertyValues( aNames, aValues ); } |