X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2277aeccc861f2a83b8ee13c5ce2d5ad9668974d..4e5a4c69c540b430fba8efe5dae1bc1ffd5caeca:/src/common/statbar.cpp diff --git a/src/common/statbar.cpp b/src/common/statbar.cpp index f868fbb29c..fbea039979 100644 --- a/src/common/statbar.cpp +++ b/src/common/statbar.cpp @@ -38,7 +38,7 @@ // wxStatusBarBase implementation // ============================================================================ -// IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow) This doesn't beling here, RR +IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow) // ---------------------------------------------------------------------------- // ctor/dtor @@ -127,12 +127,16 @@ wxArrayInt wxStatusBarBase::CalculateAbsWidths(wxCoord widthTotal) const if ( m_statusWidths == NULL ) { - // default: all fields have the same width - int nWidth = widthTotal / m_nFields; - for ( int i = 0; i < m_nFields; i++ ) + if ( m_nFields ) { - widths.Add(nWidth); + // default: all fields have the same width + int nWidth = widthTotal / m_nFields; + for ( int i = 0; i < m_nFields; i++ ) + { + widths.Add(nWidth); + } } + //else: we're empty anyhow } else // have explicit status widths {