From 8acad210fa179e699cfbb095d24b23b3fbf38dbc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Nov 2008 21:51:51 +0000 Subject: [PATCH] don't make wxGridTableBase::IsEmptyCell() pure virtual, there is really no point to force all derived table classes to implement it when it has a default implementation which works just fine in 99% of cases git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/grid.h | 6 ++++-- interface/wx/grid.h | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 075bd336fd..5e1c924ca2 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -918,7 +918,10 @@ public: { return const_cast(this)->GetNumberCols(); } - virtual bool IsEmptyCell( int row, int col ) = 0; + virtual bool IsEmptyCell( int row, int col ) + { + return GetValue(row, col).empty(); + } bool IsEmpty(const wxGridCellCoords& coord) { @@ -1071,7 +1074,6 @@ public: int GetNumberCols(); wxString GetValue( int row, int col ); void SetValue( int row, int col, const wxString& s ); - bool IsEmptyCell( int row, int col ); // overridden functions from wxGridTableBase // diff --git a/interface/wx/grid.h b/interface/wx/grid.h index 057ef18b7f..3f04db61a8 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -673,9 +673,14 @@ public: //@{ /** - Must be overridden to implement testing for empty cells. + May be overridden to implement testing for empty cells. + + This method is used by the grid to test if the given cell is not used + and so whether a neighbouring cell may overflow into it. By default it + only returns true if the value of the given cell, as returned by + GetValue(), is empty. */ - virtual bool IsEmptyCell(int row, int col) = 0; + virtual bool IsEmptyCell(int row, int col); /** Same as IsEmptyCell() but taking wxGridCellCoords.