Rename wxGridBlockCoords::ContainsCell() and move it inline
Make the function name more grammatically correct. No real changes.
This commit is contained in:
@@ -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,
|
||||
|
@@ -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.
|
||||
|
@@ -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,
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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]")
|
||||
|
Reference in New Issue
Block a user