X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a93e536be025cae6ebdae27c940a72ff59c0a006..4e5a4c69c540b430fba8efe5dae1bc1ffd5caeca:/src/common/statbar.cpp diff --git a/src/common/statbar.cpp b/src/common/statbar.cpp index bd3a277d88..fbea039979 100644 --- a/src/common/statbar.cpp +++ b/src/common/statbar.cpp @@ -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 {