Kaydet (Commit) 753c474b authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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/23909Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 5a4b01f6
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment