Kaydet (Commit) 6ad1eebb authored tarafından Frank Schönheit [fs]'s avatar Frank Schönheit [fs]

be more tolerant when setting the TextAlign, given that the property is 16 bit,…

be more tolerant when setting the TextAlign, given that the property is 16 bit, but css.awt.TextAlign is 32 bit
üst b04b7b19
...@@ -416,14 +416,14 @@ sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldV ...@@ -416,14 +416,14 @@ sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldV
bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, ::getCppuType((const sal_Int32*)NULL)); bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, ::getCppuType((const sal_Int32*)NULL));
break; break;
case PROPERTY_ID_ALIGN: 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)); sal_Int32 nAlign( 0 );
} if ( rConvertedValue >>= nAlign )
catch(starlang::IllegalArgumentException&) rConvertedValue <<= (sal_Int16)nAlign;
{
OSL_ENSURE(0,"OGridColumn::convertFastPropertyValue: TextAlign must be casted to sal_Int16!");
throw;
} }
break; break;
case PROPERTY_ID_HIDDEN: case PROPERTY_ID_HIDDEN:
......
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