Don't fill wxListEvent::m_item when using virtual list control in wxMSW.

When using virtual list control the main program already has the items data so
it's completely useless to call GetItem() when preparing an event for it. It
is also inefficient to call GetItem() for potentially many items.

For both of these reasons the generic version already didn't fill the item
contents for virtual list controls events. Now modify wxMSW to not do it
neither.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-01-05 12:51:40 +00:00
parent 1e40bd4c74
commit 8c62f53ee2

View File

@@ -2528,7 +2528,11 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
// fill in the item before passing it to the event handler if we do have a // fill in the item before passing it to the event handler if we do have a
// valid item index and haven't filled it yet (e.g. for LVN_ITEMCHANGED) // valid item index and haven't filled it yet (e.g. for LVN_ITEMCHANGED)
if ( event.m_itemIndex != -1 && !event.m_item.GetMask() ) // and we're not using a virtual control as in this case the program
// already has the data anyhow and we don't want to call GetItem() for
// potentially many items
if ( event.m_itemIndex != -1 && !event.m_item.GetMask()
&& !IsVirtual() )
{ {
wxListItem& item = event.m_item; wxListItem& item = event.m_item;