]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/vscroll.cpp
gdk_draw_pixmap -> gdk_draw_drawable
[wxWidgets.git] / src / generic / vscroll.cpp
index 1f2c1c16b127ae450a657536107f64e0657a9ed6..cee98cef45b63d912ef3c8854184094b9835c6d5 100644 (file)
@@ -772,16 +772,20 @@ void wxHVScrolledWindow::SetRowColumnCounts(size_t rowCount, size_t columnCount)
 
     // 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);
 }
@@ -993,7 +997,7 @@ bool wxHVScrolledWindow::Layout()
         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;
     }