]> git.saurik.com Git - wxWidgets.git/commitdiff
Eliminated two unneeded arguments from wxPropertyGrid::DoDrawItems()
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 7 Feb 2009 13:38:27 +0000 (13:38 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sat, 7 Feb 2009 13:38:27 +0000 (13:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
src/propgrid/propgrid.cpp

index e0edca337dbb371483c177ffb3cc626fca97ce28..bb78a4eb818f577b8861845c1a0e68dc09779ef3 100644 (file)
@@ -1739,9 +1739,7 @@ protected:
     bool DoClearSelection();
 
     int DoDrawItems( wxDC& dc,
-                     const wxPGProperty* first_item,
-                     const wxPGProperty* last_item,
-                     const wxRect* clip_rect,
+                     const wxRect* clipRect,
                      bool isBuffered ) const;
 
     /** Draws an expand/collapse (ie. +/-) button.
index 29fde9f3a0b6a17088b6069ffc88c45960ccdfe3..a9c96cb0ae06f4263970dc8d50ac95c14a0b1149 100644 (file)
@@ -1562,7 +1562,7 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
         if ( dcPtr )
         {
             dc.SetClippingRegion( *clipRect );
-            paintFinishY = DoDrawItems( *dcPtr, NULL, NULL, clipRect, isBuffered );
+            paintFinishY = DoDrawItems( *dcPtr, clipRect, isBuffered );
         }
 
     #if wxPG_DOUBLE_BUFFER
@@ -1588,30 +1588,17 @@ void wxPropertyGrid::DrawItems( wxDC& dc,
 // -----------------------------------------------------------------------
 
 int wxPropertyGrid::DoDrawItems( wxDC& dc,
-                                 const wxPGProperty* firstItem,
-                                 const wxPGProperty* lastItem,
                                  const wxRect* clipRect,
                                  bool isBuffered ) const
 {
-    // TODO: This should somehow be eliminated.
-    wxRect tempClipRect;
-    if ( !clipRect )
-    {
-        wxASSERT(firstItem);
-        wxASSERT(lastItem);
-        tempClipRect = GetPropertyRect(firstItem, lastItem);
-        clipRect = &tempClipRect;
-    }
+    const wxPGProperty* firstItem;
+    const wxPGProperty* lastItem;
 
-    if ( !firstItem )
-        firstItem = DoGetItemAtY(clipRect->y);
+    firstItem = DoGetItemAtY(clipRect->y);
+    lastItem = DoGetItemAtY(clipRect->y+clipRect->height-1);
 
     if ( !lastItem )
-    {
-        lastItem = DoGetItemAtY(clipRect->y+clipRect->height-1);
-        if ( !lastItem )
-            lastItem = GetLastItem( wxPG_ITERATE_VISIBLE );
-    }
+        lastItem = GetLastItem( wxPG_ITERATE_VISIBLE );
 
     if ( m_frozen || m_height < 1 || firstItem == NULL )
         return clipRect->y;