Consistently write loops over wxRegionIterator in the same way
Standardize on a single loop for all versions of it and prefer to use "for" loops with the iterator increment directly in the loop statement instead of using "while" loops with the increment somewhere inside the loop, where it could be possibly skipped by a "continue" statement. No real changes.
This commit is contained in:
@@ -3678,13 +3678,12 @@ bool wxGrid::Redimension( wxGridTableMessage& msg )
|
||||
|
||||
wxArrayInt wxGrid::CalcRowLabelsExposed( const wxRegion& reg, wxGridWindow *gridWindow ) const
|
||||
{
|
||||
wxRegionIterator iter( reg );
|
||||
wxRect r;
|
||||
|
||||
wxArrayInt rowlabels;
|
||||
|
||||
int top, bottom;
|
||||
while ( iter )
|
||||
for ( wxRegionIterator iter( reg ); iter; ++iter )
|
||||
{
|
||||
r = iter.GetRect();
|
||||
r.Offset(GetGridWindowOffset(gridWindow));
|
||||
@@ -3724,8 +3723,6 @@ wxArrayInt wxGrid::CalcRowLabelsExposed( const wxRegion& reg, wxGridWindow *grid
|
||||
|
||||
rowlabels.Add( row );
|
||||
}
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
return rowlabels;
|
||||
@@ -3733,13 +3730,12 @@ wxArrayInt wxGrid::CalcRowLabelsExposed( const wxRegion& reg, wxGridWindow *grid
|
||||
|
||||
wxArrayInt wxGrid::CalcColLabelsExposed( const wxRegion& reg, wxGridWindow *gridWindow ) const
|
||||
{
|
||||
wxRegionIterator iter( reg );
|
||||
wxRect r;
|
||||
|
||||
wxArrayInt colLabels;
|
||||
|
||||
int left, right;
|
||||
while ( iter )
|
||||
for ( wxRegionIterator iter( reg ); iter; ++iter )
|
||||
{
|
||||
r = iter.GetRect();
|
||||
r.Offset( GetGridWindowOffset(gridWindow) );
|
||||
@@ -3779,8 +3775,6 @@ wxArrayInt wxGrid::CalcColLabelsExposed( const wxRegion& reg, wxGridWindow *grid
|
||||
|
||||
colLabels.Add( col );
|
||||
}
|
||||
|
||||
++iter;
|
||||
}
|
||||
|
||||
return colLabels;
|
||||
|
||||
Reference in New Issue
Block a user