fix crash when repositioning tools without labels in DoDeleteTool() (ticket #9530)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -581,12 +581,14 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
|
|||||||
wxToolBarTool *tool2 = (wxToolBarTool*)node->GetData();
|
wxToolBarTool *tool2 = (wxToolBarTool*)node->GetData();
|
||||||
if ( tool2->IsControl() )
|
if ( tool2->IsControl() )
|
||||||
{
|
{
|
||||||
|
wxControl * const control = tool2->GetControl();
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
wxControl *control = tool2->GetControl();
|
|
||||||
control->GetPosition(&x, NULL);
|
control->GetPosition(&x, NULL);
|
||||||
control->Move(x - width, wxDefaultCoord);
|
control->Move(x - width, wxDefaultCoord);
|
||||||
|
|
||||||
wxStaticText* staticText = tool2->GetStaticText();
|
wxStaticText * const staticText = tool2->GetStaticText();
|
||||||
|
if ( staticText )
|
||||||
staticText->Move(x - width, wxDefaultCoord);
|
staticText->Move(x - width, wxDefaultCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user