Rename and simplify wxGridBlockCoords::ContainsBlock()
Change the return type of this function to a simple and clear bool instead of 3-valued int requiring a special explanation. This is simpler and not any less efficient as checking for whether one block contains another or the other one contains this one are separate operations anyhow. Rename the function to a more grammatically correct name. Also move it inline as it's now trivial enough for this to be worth it.
This commit is contained in:
@@ -823,11 +823,12 @@ public:
|
||||
m_leftCol <= cell.GetCol() && cell.GetCol() <= m_rightCol;
|
||||
}
|
||||
|
||||
// Whether the blocks contain each other.
|
||||
// returns 1, if this block contains the other,
|
||||
// -1, if the other block contains this one,
|
||||
// 0, otherwise
|
||||
int ContainBlock(const wxGridBlockCoords& other) const;
|
||||
// Return whether this blocks fully contains another one.
|
||||
bool ContainsBlock(const wxGridBlockCoords& other) const
|
||||
{
|
||||
return m_topRow <= other.m_topRow && other.m_bottomRow <= m_bottomRow &&
|
||||
m_leftCol <= other.m_leftCol && other.m_rightCol <= m_rightCol;
|
||||
}
|
||||
|
||||
// Calculates the result blocks by subtracting the other block from this
|
||||
// block. splitOrientation can be wxVERTICAL or wxHORIZONTAL.
|
||||
|
Reference in New Issue
Block a user