Kaydet (Commit) f02ee5b7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid unnecessary bad downcasts to Button

Change-Id: I36baaa1cd46385430474f8a841eafaaba07a18fc
üst 9473ba24
......@@ -236,8 +236,7 @@ void VCLXGraphicControl::setProperty( const OUString& PropertyName, const ::com:
{
SolarMutexGuard aGuard;
Button* pButton = static_cast< Button* >( GetWindow() );
if ( !pButton )
if ( !GetWindow() )
return;
sal_uInt16 nPropType = GetPropertyId( PropertyName );
switch ( nPropType )
......@@ -261,9 +260,12 @@ void VCLXGraphicControl::setProperty( const OUString& PropertyName, const ::com:
{
sal_Int16 nAlignment = sal_Int16();
if ( Value >>= nAlignment )
{
Button* pButton = static_cast< Button* >( GetWindow() );
pButton->SetImageAlign( static_cast< ImageAlign >( nAlignment ) );
}
}
}
break;
case BASEPROPERTY_IMAGEPOSITION:
{
......@@ -275,6 +277,7 @@ void VCLXGraphicControl::setProperty( const OUString& PropertyName, const ::com:
{
sal_Int16 nImagePosition = 2;
OSL_VERIFY( Value >>= nImagePosition );
Button* pButton = static_cast< Button* >( GetWindow() );
pButton->SetImageAlign( ::toolkit::translateImagePosition( nImagePosition ) );
}
}
......
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