// recalculate the scrollbars parameters
if(m_rowsFirst >= rowCount)
- m_rowsFirst = rowCount-1;
+ m_rowsFirst = (rowCount > 0) ? rowCount - 1 : 0;
if(m_columnsFirst >= columnCount)
- m_columnsFirst = columnCount-1;
+ m_columnsFirst = (columnCount > 0) ? columnCount - 1 : 0;
+#if 0
+ // checks disabled due to size_t type of members
+ // but leave them here if anyone would want to do some debugging
if(m_rowsFirst < 0)
m_rowsFirst = 0;
if(m_columnsFirst < 0)
m_columnsFirst = 0;
+#endif
ScrollToRowColumn(m_rowsFirst, m_columnsFirst);
}
y = -GetRowsHeight(0, GetVisibleRowsBegin());
x = -GetColumnsWidth(0, GetVisibleColumnsBegin());
GetVirtualSize(&w, &h);
- GetSizer()->SetDimension(0, y, w, h);
+ GetSizer()->SetDimension(x, y, w, h);
return true;
}