]> git.saurik.com Git - wxWidgets.git/commitdiff
ensure there is a current cell before using it to try and get width/height
authorRobin Dunn <robin@alldunn.com>
Thu, 26 Apr 2007 00:15:42 +0000 (00:15 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 26 Apr 2007 00:15:42 +0000 (00:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index be6c466a26636e4597a6d7b56a14f3a94c2fd789..e521109b0aab8d7bc438c0f9eef7edc4fdf810c3 100644 (file)
@@ -9662,7 +9662,7 @@ void wxGrid::SetCellHighlightPenWidth(int width)
         // make any visible change if the the thickness is getting smaller.
         int row = m_currentCellCoords.GetRow();
         int col = m_currentCellCoords.GetCol();
-        if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 )
+        if ( row == -1 || col == -1 || GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 )
             return;
 
         wxRect rect = CellToRect(row, col);