From 6ad1eebbe252c983a3f915912cd119e36af0bfed Mon Sep 17 00:00:00 2001 From: "Frank Schönheit [fs]" Date: Wed, 4 Nov 2009 09:51:23 +0100 Subject: be more tolerant when setting the TextAlign, given that the property is 16 bit, but css.awt.TextAlign is 32 bit --- forms/source/component/Columns.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'forms') diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx index c8d868591029..29d6f1130509 100644 --- a/forms/source/component/Columns.cxx +++ b/forms/source/component/Columns.cxx @@ -416,14 +416,14 @@ sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldV bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, ::getCppuType((const sal_Int32*)NULL)); break; case PROPERTY_ID_ALIGN: - try + bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, ::getCppuType( (const sal_Int32*)NULL ) ); + // strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls + // and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit + if ( bModified ) { - bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aAlign, ::getCppuType((const sal_Int16*)NULL)); - } - catch(starlang::IllegalArgumentException&) - { - OSL_ENSURE(0,"OGridColumn::convertFastPropertyValue: TextAlign must be casted to sal_Int16!"); - throw; + sal_Int32 nAlign( 0 ); + if ( rConvertedValue >>= nAlign ) + rConvertedValue <<= (sal_Int16)nAlign; } break; case PROPERTY_ID_HIDDEN: -- cgit