diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 762c4e099d..fcb2f8b4b8 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -816,10 +816,12 @@ public: m_leftCol <= other.m_rightCol && m_rightCol >= other.m_leftCol; } - // Whether the block contains the cell. - // returns @true, if the block contains the cell, - // @false, otherwise - bool ContainCell(const wxGridCellCoords& cell) const; + // Return whether this block contains the given cell. + bool ContainsCell(const wxGridCellCoords& cell) const + { + return m_topRow <= cell.GetRow() && cell.GetRow() <= m_bottomRow && + m_leftCol <= cell.GetCol() && cell.GetCol() <= m_rightCol; + } // Whether the blocks contain each other. // returns 1, if this block contains the other, diff --git a/interface/wx/grid.h b/interface/wx/grid.h index 1976ff27da..6e263abb58 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -1916,12 +1916,12 @@ public: } /** - Whether the block contains the cell. + Check whether this block contains the given cell. @return - @true, if the block contains the cell, @false, otherwise. + @true, if the block contains the cell, @false otherwise. */ - bool ContainCell(const wxGridCellCoords& cell) const; + bool ContainsCell(const wxGridCellCoords& cell) const; /** Whether the blocks contain each other. diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 1dca09bd95..ed5a8bc3d3 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1140,12 +1140,6 @@ const wxGridCornerHeaderRenderer& wxGridCellAttrProvider::GetCornerRenderer() // wxGridBlockCoords // ---------------------------------------------------------------------------- -bool wxGridBlockCoords::ContainCell(const wxGridCellCoords& cell) const -{ - return m_topRow <= cell.GetRow() && cell.GetRow() <= m_bottomRow && - m_leftCol <= cell.GetCol() && cell.GetCol() <= m_rightCol; -} - int wxGridBlockCoords::ContainBlock(const wxGridBlockCoords& other) const { // returns 1, if this block contains the other, diff --git a/src/generic/gridsel.cpp b/src/generic/gridsel.cpp index 6ab871bf9a..62ea7312d7 100644 --- a/src/generic/gridsel.cpp +++ b/src/generic/gridsel.cpp @@ -61,7 +61,7 @@ bool wxGridSelection::IsInSelection( int row, int col ) const size_t count = m_selection.size(); for ( size_t n = 0; n < count; n++ ) { - if ( m_selection[n].ContainCell(wxGridCellCoords(row, col)) ) + if ( m_selection[n].ContainsCell(wxGridCellCoords(row, col)) ) return true; } diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index d32e94e955..f1749634c9 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -1328,13 +1328,13 @@ TEST_CASE("GridBlockCoords::Intersects", "[grid]") CHECK(!wxGridBlockCoords(1, 1, 3, 3).Intersects(wxGridBlockCoords(4, 4, 6, 6))); } -TEST_CASE("GridBlockCoords::ContainCell", "[grid]") +TEST_CASE("GridBlockCoords::ContainsCell", "[grid]") { // Inside. - CHECK(wxGridBlockCoords(1, 1, 3, 3).ContainCell(wxGridCellCoords(2, 2))); + CHECK(wxGridBlockCoords(1, 1, 3, 3).ContainsCell(wxGridCellCoords(2, 2))); // Outside. - CHECK(!wxGridBlockCoords(1, 1, 3, 3).ContainCell(wxGridCellCoords(5, 5))); + CHECK(!wxGridBlockCoords(1, 1, 3, 3).ContainsCell(wxGridCellCoords(5, 5))); } TEST_CASE("GridBlockCoords::ContainBlock", "[grid]")