]> git.saurik.com Git - wxWidgets.git/commitdiff
don't ignore cache hints with from == to
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 3 Jun 2003 21:22:35 +0000 (21:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 3 Jun 2003 21:22:35 +0000 (21:22 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 4d906a5c85a5a59eeb07c4ef99b60688e9fed84a..b009824380f8afb63c6f7323367e31b31e35bf07 100644 (file)
@@ -2080,21 +2080,18 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 
                     eventType = wxEVT_COMMAND_LIST_CACHE_HINT;
 
-                    // we get some really stupid cache hints like ones for items in
-                    // range 0..0 for an empty control or, after deleting an item,
-                    // for items in invalid range - filter this garbage out
-                    if ( cacheHint->iFrom < cacheHint->iTo )
-                    {
-                        event.m_oldItemIndex = cacheHint->iFrom;
-
-                        long iMax = GetItemCount();
-                        event.m_itemIndex = cacheHint->iTo < iMax ? cacheHint->iTo
-                                                                  : iMax - 1;
-                    }
-                    else
-                    {
+                    // we get some really stupid cache hints like ones for
+                    // items in range 0..0 for an empty control or, after
+                    // deleting an item, for items in invalid range -- filter
+                    // this garbage out
+                    if ( cacheHint->iFrom > cacheHint->iTo )
                         return FALSE;
-                    }
+
+                    event.m_oldItemIndex = cacheHint->iFrom;
+
+                    const long iMax = GetItemCount();
+                    event.m_itemIndex = cacheHint->iTo < iMax ? cacheHint->iTo
+                                                              : iMax - 1;
                 }
                 break;