X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01dd42b61fa66cece6e8500e6dc90a9f4784cca1..1bf38b0eda268c1613ea36d6a30caa478a261c74:/src/generic/grid.cpp?ds=sidebyside diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 65d60341f8..48ff5cf934 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -2431,7 +2431,8 @@ void wxGridCellAttrData::UpdateAttrRows( size_t pos, int numRows ) else { // ...or remove the attribute - m_attrs[n].attr->DecRef(); + // No need to DecRef the attribute itself since this is + // done be wxGridCellWithAttr's destructor! m_attrs.RemoveAt(n); n--; count--; } @@ -2465,7 +2466,8 @@ void wxGridCellAttrData::UpdateAttrCols( size_t pos, int numCols ) else { // ...or remove the attribute - m_attrs[n].attr->DecRef(); + // No need to DecRef the attribute itself since this is + // done be wxGridCellWithAttr's destructor! m_attrs.RemoveAt(n); n--; count--; } @@ -7522,6 +7524,16 @@ void wxGrid::ForceRefresh() EndBatch(); } +bool wxGrid::Enable(bool enable) +{ + if ( !wxScrolledWindow::Enable(enable) ) + return false; + + // redraw in the new state + m_gridWin->Refresh(); + + return true; +} // // ------ Edit control functions @@ -10184,7 +10196,7 @@ wxRect wxGrid::BlockToDeviceRect( const wxGridCellCoords &topLeft, } else { - rect = wxRect( 0, 0, 0, 0 ); + rect = wxRect(); } cellRect = CellToRect( bottomRight ); @@ -10259,7 +10271,7 @@ wxRect wxGrid::BlockToDeviceRect( const wxGridCellCoords &topLeft, m_gridWin->GetClientSize( &cw, &ch ); if (right < 0 || bottom < 0 || left > cw || top > ch) - return wxRect( 0, 0, 0, 0); + return wxRect(); rect.SetLeft( wxMax(0, left) ); rect.SetTop( wxMax(0, top) );