X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/71e030352d74e4e6aed28cfcb0ea6edf3d17af6e..9f4de6b2cf06f53a98b28f53640f3b9ec8cf4182:/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 {