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

Avoid unnecessary bad downcasts to ToolBox

Change-Id: I239aee06ce543b6f7c213d845313ca51b3a5502d
üst f02ee5b7
...@@ -528,12 +528,12 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow ...@@ -528,12 +528,12 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
// to prevent an early release of the toolbox (VCLEVENT_OBJECT_DYING) // to prevent an early release of the toolbox (VCLEVENT_OBJECT_DYING)
Reference< XAccessibleContext > xTemp = this; Reference< XAccessibleContext > xTemp = this;
ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
switch ( rVclWindowEvent.GetId() ) switch ( rVclWindowEvent.GetId() )
{ {
case VCLEVENT_TOOLBOX_CLICK: case VCLEVENT_TOOLBOX_CLICK:
case VCLEVENT_TOOLBOX_SELECT: case VCLEVENT_TOOLBOX_SELECT:
{ {
ToolBox* pToolBox = static_cast< ToolBox* >( GetWindow() );
if ( rVclWindowEvent.GetData() ) if ( rVclWindowEvent.GetData() )
{ {
UpdateChecked_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) ); UpdateChecked_Impl( (sal_Int32)reinterpret_cast<sal_IntPtr>(rVclWindowEvent.GetData()) );
...@@ -617,14 +617,14 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow ...@@ -617,14 +617,14 @@ void VCLXAccessibleToolBox::ProcessWindowEvent( const VclWindowEvent& rVclWindow
case VCLEVENT_OBJECT_DYING : case VCLEVENT_OBJECT_DYING :
{ {
// if this toolbox is a subtoolbox, we have to relese it from its parent // if this toolbox is a subtoolbox, we have to relese it from its parent
ToolBox* pBox = static_cast< ToolBox* >( GetWindow() ); vcl::Window * pWin = GetWindow();
if ( pBox && pBox->GetParent() && if ( pWin && pWin->GetParent() &&
pBox->GetParent()->GetType() == WINDOW_TOOLBOX ) pWin->GetParent()->GetType() == WINDOW_TOOLBOX )
{ {
VCLXAccessibleToolBox* pParent = static_cast< VCLXAccessibleToolBox* >( VCLXAccessibleToolBox* pParent = static_cast< VCLXAccessibleToolBox* >(
pBox->GetParent()->GetAccessible()->getAccessibleContext().get() ); pWin->GetParent()->GetAccessible()->getAccessibleContext().get() );
if ( pParent ) if ( pParent )
pParent->ReleaseSubToolBox( pBox ); pParent->ReleaseSubToolBox(static_cast<ToolBox *>(pWin));
} }
// dispose all items // dispose all items
......
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