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