Slightly more efficient wxDataViewCtrl::StartEditor().

Don't compute item rect until we know for sure that the item actually is
editable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2011-09-03 13:14:23 +00:00
parent c2efa4b48a
commit 2c336e249e

View File

@@ -4632,10 +4632,12 @@ void wxDataViewCtrl::StartEditor( const wxDataViewItem & item, unsigned int colu
if (!col)
return;
wxRect itemRect = GetItemRect(item, col);
wxDataViewRenderer* renderer = col->GetRenderer();
if (renderer->GetMode() == wxDATAVIEW_CELL_EDITABLE)
renderer->StartEditing(item, itemRect);
if (renderer->GetMode() != wxDATAVIEW_CELL_EDITABLE)
return;
const wxRect itemRect = GetItemRect(item, col);
renderer->StartEditing(item, itemRect);
}
#endif // !wxUSE_GENERICDATAVIEWCTRL