summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-02-24 10:24:48 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-02-24 13:25:14 +0100
commitf02ee5b727e75d850fd054d18dd0e0320002109a (patch)
tree6d57b63c11df99c845939fc9a18a6ba05dcdd530 /toolkit
parent9473ba24698ab5b98a72b38c3a38f7cddd45411e (diff)
Avoid unnecessary bad downcasts to Button
Change-Id: I36baaa1cd46385430474f8a841eafaaba07a18fc
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxwindows.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 6187119904d1..1b51690da4d5 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -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,7 +260,10 @@ 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;
@@ -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 ) );
}
}