fixed crash when no status bar is present, conditionals around optional parts

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-09-18 07:52:49 +00:00
parent 8a3e173a02
commit 50d8f02279

View File

@@ -345,14 +345,18 @@ void wxFrame::PositionToolBar()
GetSize( &cw , &ch ) ; GetSize( &cw , &ch ) ;
int statusX, statusY; int statusX = 0 ;
GetStatusBar()->GetClientSize(&statusX, &statusY); int statusY = 0 ;
#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown()) if (GetStatusBar() && GetStatusBar()->IsShown())
{ {
GetStatusBar()->GetClientSize(&statusX, &statusY);
ch -= statusY; ch -= statusY;
} }
#endif
#if wxUSE_TOOLBAR
if (GetToolBar()) if (GetToolBar())
{ {
int tx, ty, tw, th; int tx, ty, tw, th;
@@ -383,6 +387,7 @@ void wxFrame::PositionToolBar()
#endif #endif
} }
} }
#endif
} }
void wxFrame::PositionBars() void wxFrame::PositionBars()