diff options
author | Frank Schönheit [fs] <frank.schoenheit@sun.com> | 2009-11-04 09:51:23 +0100 |
---|---|---|
committer | Frank Schönheit [fs] <frank.schoenheit@sun.com> | 2009-11-04 09:51:23 +0100 |
commit | 6ad1eebbe252c983a3f915912cd119e36af0bfed (patch) | |
tree | 18ee8edd61c5248b447822df32a908b03f28ae72 /forms | |
parent | b04b7b19d0f0f0e32254039134e1ed7812bbc74f (diff) |
be more tolerant when setting the TextAlign, given that the property is 16 bit, but css.awt.TextAlign is 32 bit
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/Columns.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
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: |