X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d5fda5dc6f875a20210cd6d7f6b5b794519bd52..d91eb06e9c6626c246e4b18587165bcda5126644:/src/generic/grid.cpp?ds=sidebyside diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 945a7914bc..0c7b85e417 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2751,9 +2751,13 @@ void wxGridRowOrColAttrData::SetAttr(wxGridCellAttr *attr, int rowOrCol) int i = m_rowsOrCols.Index(rowOrCol); if ( i == wxNOT_FOUND ) { - // add the attribute - m_rowsOrCols.Add(rowOrCol); - m_attrs.Add(attr); + if ( attr ) + { + // add the attribute + m_rowsOrCols.Add(rowOrCol); + m_attrs.Add(attr); + } + // nothing to remove } else { @@ -4221,6 +4225,7 @@ bool wxGrid::Create(wxWindow *parent, wxWindowID id, Create(); SetInitialSize(size); + CalcDimensions(); return true; } @@ -6953,8 +6958,11 @@ void wxGrid::Refresh(bool eraseb, const wxRect* rect) void wxGrid::OnSize(wxSizeEvent& WXUNUSED(event)) { - // update our children window positions and scrollbars - CalcDimensions(); + if (m_targetWindow != this) // check whether initialisation has been done + { + // update our children window positions and scrollbars + CalcDimensions(); + } } void wxGrid::OnKeyDown( wxKeyEvent& event )