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:
Vadim Zeitlin
2008-06-03 12:45:43 +00:00
parent 92159e3d76
commit 345d60d357

View File

@@ -581,13 +581,15 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool)
wxToolBarTool *tool2 = (wxToolBarTool*)node->GetData();
if ( tool2->IsControl() )
{
wxControl * const control = tool2->GetControl();
int x;
wxControl *control = tool2->GetControl();
control->GetPosition(&x, NULL);
control->Move(x - width, wxDefaultCoord);
wxStaticText* staticText = tool2->GetStaticText();
staticText->Move(x - width, wxDefaultCoord);
wxStaticText * const staticText = tool2->GetStaticText();
if ( staticText )
staticText->Move(x - width, wxDefaultCoord);
}
}