summaryrefslogtreecommitdiff
path: root/src/Fl_Table.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Table.cxx')
-rw-r--r--src/Fl_Table.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx
index e19fc2fbe..c238a8d1d 100644
--- a/src/Fl_Table.cxx
+++ b/src/Fl_Table.cxx
@@ -76,7 +76,8 @@ long Fl_Table::row_scroll_position(int row) {
scroll = toprow_scrollpos;
startrow = toprow;
}
- for ( int t=startrow; t<row; t++ ) {
+ int t;
+ for (t =startrow; t<row; t++ ) {
scroll += row_height(t);
}
return(scroll);
@@ -95,7 +96,8 @@ long Fl_Table::col_scroll_position(int col) {
scroll = leftcol_scrollpos;
startcol = leftcol;
}
- for ( int t=startcol; t<col; t++ ) {
+ int t;
+ for (t =startcol; t<col; t++ ) {
scroll += col_width(t);
}
return(scroll);
@@ -1339,8 +1341,10 @@ void Fl_Table::draw() {
// Only redraw a few cells?
if ( ! ( damage() & FL_DAMAGE_ALL ) && _redraw_leftcol != -1 ) {
fl_push_clip(tix, tiy, tiw, tih);
- for ( int c = _redraw_leftcol; c <= _redraw_rightcol; c++ ) {
- for ( int r = _redraw_toprow; r <= _redraw_botrow; r++ ) {
+ int c;
+ for (c = _redraw_leftcol; c <= _redraw_rightcol; c++ ) {
+ int r;
+ for (r = _redraw_toprow; r <= _redraw_botrow; r++ ) {
_redraw_cell(CONTEXT_CELL, r, c);
}
}
@@ -1348,11 +1352,12 @@ void Fl_Table::draw() {
}
if ( damage() & FL_DAMAGE_ALL ) {
int X,Y,W,H;
+ int r, c;
// Draw row headers, if any
if ( row_header() ) {
get_bounds(CONTEXT_ROW_HEADER, X, Y, W, H);
fl_push_clip(X,Y,W,H);
- for ( int r = toprow; r <= botrow; r++ ) {
+ for (r = toprow; r <= botrow; r++ ) {
_redraw_cell(CONTEXT_ROW_HEADER, r, 0);
}
fl_pop_clip();
@@ -1361,7 +1366,7 @@ void Fl_Table::draw() {
if ( col_header() ) {
get_bounds(CONTEXT_COL_HEADER, X, Y, W, H);
fl_push_clip(X,Y,W,H);
- for ( int c = leftcol; c <= rightcol; c++ ) {
+ for (c = leftcol; c <= rightcol; c++ ) {
_redraw_cell(CONTEXT_COL_HEADER, 0, c);
}
fl_pop_clip();
@@ -1373,8 +1378,8 @@ void Fl_Table::draw() {
// drawing over deadzones; prevent deadzones by sizing columns.
//
fl_push_clip(tix, tiy, tiw, tih); {
- for ( int r = toprow; r <= botrow; r++ ) {
- for ( int c = leftcol; c <= rightcol; c++ ) {
+ for (r = toprow; r <= botrow; r++ ) {
+ for (c = leftcol; c <= rightcol; c++ ) {
_redraw_cell(CONTEXT_CELL, r, c);
}
}