summaryrefslogtreecommitdiff
path: root/win/terrctrl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'win/terrctrl.cpp')
-rw-r--r--win/terrctrl.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/win/terrctrl.cpp b/win/terrctrl.cpp
index 853138f..284d8db 100644
--- a/win/terrctrl.cpp
+++ b/win/terrctrl.cpp
@@ -511,7 +511,9 @@ void CTerrainCtrl::OnDraw(CDC* pDC)
*/
// calc bottom
int bottom = GetFixedRowHeight();
- for (int i = idTopLeft.row; i < m_nRows; i++)
+ int i;
+
+ for (i = idTopLeft.row; i < m_nRows; i++)
{
bottom += GetRowHeight(i);
if (bottom >= clientRect.bottom)
@@ -1293,7 +1295,9 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck)
else if (point.x < fixedColWidth) // in fixed col
{
int xpos = 0;
- for (int col = 0; col < m_nFixedCols; col++)
+ int col;
+
+ for (col = 0; col < m_nFixedCols; col++)
{
xpos += GetColumnWidth(col);
if (xpos > point.x) break;
@@ -1303,7 +1307,9 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck)
else // in non-fixed col
{
int xpos = fixedColWidth;
- for (int col = idTopLeft.col; col < m_nCols; col++)
+ int col;
+
+ for (col = idTopLeft.col; col < m_nCols; col++)
{
xpos += GetColumnWidth(col);
if (xpos > point.x) break;
@@ -1322,7 +1328,9 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck)
else if (point.y < fixedRowHeight) // in fixed col
{
int ypos = 0;
- for (int row = 0; row < m_nFixedRows; row++)
+ int row;
+
+ for (row = 0; row < m_nFixedRows; row++)
{
ypos += GetRowHeight(row);
if (ypos > point.y) break;
@@ -1332,7 +1340,9 @@ CELLID CTerrainCtrl::GetCellFromPt(CPoint point, BOOL bAllowFixedCellCheck)
else
{
int ypos = fixedRowHeight;
- for (int row = idTopLeft.row; row < GetRowCount(); row++)
+ int row;
+
+ for (row = idTopLeft.row; row < GetRowCount(); row++)
{
ypos += GetRowHeight(row);
if (ypos > point.y) break;
@@ -1792,7 +1802,9 @@ void CTerrainCtrl::EnsureVisible(int nRow, int nCol)
// calc bottom
int bottom = GetFixedRowHeight();
- for (int i = idTopLeft.row; i < m_nRows; i++)
+ int i;
+
+ for (i = idTopLeft.row; i < m_nRows; i++)
{
bottom += GetRowHeight(i);
if (bottom >= rect.bottom)