diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-08 05:06:54 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-08 03:41:00 +0000 |
commit | 753c474b199a9c12f182c89c487133f9fa88e352 (patch) | |
tree | 33cae4887550bc9d895118c7360166dd468b129b /oox | |
parent | 5a4b01f63d3f2a7d7d6fa8cf9ca6a328c5da7a6a (diff) |
fix many ooxml validation errors
This code was just horribly broken. Every requested property would
return the color value which if interepreted as an alpha value gave
invalid values.
This now contains an assert that might trigger in the next set of crash
testing.
Change-Id: I959084dbce2d28878b50ec52ece71397d4ace561
Reviewed-on: https://gerrit.libreoffice.org/23909
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/ColorPropertySet.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/oox/source/export/ColorPropertySet.cxx b/oox/source/export/ColorPropertySet.cxx index 3fb4b9ab1ad5..bab61b0d9199 100644 --- a/oox/source/export/ColorPropertySet.cxx +++ b/oox/source/export/ColorPropertySet.cxx @@ -108,13 +108,20 @@ Reference< XPropertySetInfo > SAL_CALL ColorPropertySet::getPropertySetInfo() return m_xInfo; } -void SAL_CALL ColorPropertySet::setPropertyValue( const OUString& /* aPropertyName */, const uno::Any& aValue ) +void SAL_CALL ColorPropertySet::setPropertyValue( const OUString& rPropertyName, const uno::Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException, std::exception) { + if (rPropertyName != m_aColorPropName) + { + // trying to catch these cases in the next crash testing + assert(false); + return; + } + aValue >>= m_nColor; } @@ -128,7 +135,10 @@ uno::Any SAL_CALL ColorPropertySet::getPropertyValue( const OUString& aPropertyN css::drawing::FillStyle aFillStyle = css::drawing::FillStyle_SOLID; return uno::makeAny(aFillStyle); } - return uno::makeAny( m_nColor ); + else if (aPropertyName == m_aColorPropName) + return uno::makeAny( m_nColor ); + + throw UnknownPropertyException(); } void SAL_CALL ColorPropertySet::addPropertyChangeListener( const OUString& /* aPropertyName */, const Reference< XPropertyChangeListener >& /* xListener */ ) @@ -199,6 +209,7 @@ uno::Any SAL_CALL ColorPropertySet::getPropertyDefault( const OUString& aPropert { if( aPropertyName.equals( m_aColorPropName )) return uno::makeAny( m_nDefaultColor ); + return uno::Any(); } |