From: Jaakko Salli Date: Sat, 7 Feb 2009 13:38:27 +0000 (+0000) Subject: Eliminated two unneeded arguments from wxPropertyGrid::DoDrawItems() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bcf324bebe65cd7ee49c139533ceea52dceb4b91 Eliminated two unneeded arguments from wxPropertyGrid::DoDrawItems() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index e0edca337d..bb78a4eb81 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -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. diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 29fde9f3a0..a9c96cb0ae 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -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;