diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-24 12:52:15 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-24 13:25:15 +0100 |
commit | 11292487db58c3a5e1204ba03d192f01e5e53cc4 (patch) | |
tree | e64f78943fbda66029f8544f8b17d5d5d2a99b23 /accessibility | |
parent | f02ee5b727e75d850fd054d18dd0e0320002109a (diff) |
Avoid unnecessary bad downcasts to ToolBox
Change-Id: I239aee06ce543b6f7c213d845313ca51b3a5502d
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessibletoolbox.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index a8a7cdfd5e3f..41bf9a0254ce 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -528,12 +528,12 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow // to prevent an early release of the toolbox (VCLEVENT_OBJECT_DYING) Reference< XAccessibleContext > xTemp = this; - ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); switch ( rVclWindowEvent.GetId() ) { case VCLEVENT_TOOLBOX_CLICK: case VCLEVENT_TOOLBOX_SELECT: { + ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() ); if ( rVclWindowEvent.GetData() ) { UpdateChecked_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) ); @@ -617,14 +617,14 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow case VCLEVENT_OBJECT_DYING : { // if this toolbox is a subtoolbox, we have to relese it from its parent - ToolBox* pBox = static_cast< ToolBox* >( GetWindow() ); - if ( pBox && pBox->GetParent() && - pBox->GetParent()->GetType() == WINDOW_TOOLBOX ) + vcl::Window * pWin = GetWindow(); + if ( pWin && pWin->GetParent() && + pWin->GetParent()->GetType() == WINDOW_TOOLBOX ) { VCLXAccessibleToolBox* pParent = static_cast< VCLXAccessibleToolBox* >( - pBox->GetParent()->GetAccessible()->getAccessibleContext().get() ); + pWin->GetParent()->GetAccessible()->getAccessibleContext().get() ); if ( pParent ) - pParent->ReleaseSubToolBox( pBox ); + pParent->ReleaseSubToolBox(static_cast<ToolBox *>(pWin)); } // dispose all items |