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:
@@ -1140,21 +1140,6 @@ const wxGridCornerHeaderRenderer& wxGridCellAttrProvider::GetCornerRenderer()
|
||||
// wxGridBlockCoords
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxGridBlockCoords::ContainBlock(const wxGridBlockCoords& other) const
|
||||
{
|
||||
// returns 1, if this block contains the other,
|
||||
// -1, if the other block contains this one,
|
||||
// 0, otherwise
|
||||
if ( m_topRow <= other.m_topRow && other.m_bottomRow <= m_bottomRow &&
|
||||
m_leftCol <= other.m_leftCol && other.m_rightCol <= m_rightCol )
|
||||
return 1;
|
||||
else if ( other.m_topRow <= m_topRow && m_bottomRow <= other.m_bottomRow &&
|
||||
other.m_leftCol <= m_leftCol && m_rightCol <= other.m_rightCol )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
wxGridBlockDiffResult
|
||||
wxGridBlockCoords::Difference(const wxGridBlockCoords& other,
|
||||
int splitOrientation) const
|
||||
|
Reference in New Issue
Block a user