]> git.saurik.com Git - wxWidgets.git/commitdiff
don't refresh the current cell in SetCellHighlightROPenWidth() if it's invalid (...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Jun 2008 02:09:03 +0000 (02:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 7 Jun 2008 02:09:03 +0000 (02:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 2ba9c636e89da794ba21ea3edac21c711563adef..0c01e6a71f0f712d57e62409c24f03f3682d096c 100644 (file)
@@ -2287,8 +2287,8 @@ void wxGridCellBoolRenderer::Draw(wxGrid& grid,
 
     int flags = 0;
     if (value)
-        flags |= wxCONTROL_CHECKED; 
-        
+        flags |= wxCONTROL_CHECKED;
+
     wxRendererNative::Get().DrawCheckBox( &grid, dc, rectBorder, flags );
 }
 
@@ -7214,7 +7214,7 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
     m_currentCellCoords = coords;
 
     wxGridCellAttr *attr = GetCellAttr( coords );
-#if !defined(__WXMAC__) 
+#if !defined(__WXMAC__)
     DrawCellHighlight( dc, attr );
 #endif
     attr->DecRef();
@@ -7924,7 +7924,7 @@ void wxGrid::SetUseNativeColLabels( bool native )
         int height = wxRendererNative::Get().GetHeaderButtonHeight( this );
         SetColLabelSize( height );
     }
-    
+
     m_colLabelWin->Refresh();
 }
 
@@ -8412,7 +8412,7 @@ void wxGrid::ShowCellEditControl()
                 if (rect.GetRight() > client_right)
                     rect.SetRight( client_right - 1 );
             }
-            
+
             editor->SetCellAttr( attr );
             editor->SetSize( rect );
             if (nXMove != 0)
@@ -9633,7 +9633,8 @@ void wxGrid::SetCellHighlightROPenWidth(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);