From: Vadim Zeitlin Date: Sat, 7 Jul 2012 13:27:55 +0000 (+0000) Subject: Don't call HitTest() unnecessarily in MSW wxTreeCtrl code. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d2dcbf20aa97d60147c5e44b21877e229282f436?ds=sidebyside Don't call HitTest() unnecessarily in MSW wxTreeCtrl code. We already called TreeView_HitTest() above, there is no need to call wxTreeCtrl::HitTest() again to retrieve exactly the same information. This also incidentally fixes a warning about unused variable, see #14459. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 2cfcbd8f39..e84bd1b324 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2925,10 +2925,7 @@ wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) // click if needed if ( processed ) { - int htFlags = 0; - wxTreeItemId item = HitTest(wxPoint(x, y), htFlags); - - if ( htFlags & wxTREE_HITTEST_ONITEMSTATEICON ) + if ( tvht.flags & TVHT_ONITEMSTATEICON ) { m_triggerStateImageClick = true; }