Nikolay Sivov : comctl32: Fix LVS_OWNERDRAWFIXED handling in hittesting.

Alexandre Julliard julliard at winehq.org
Mon Sep 9 16:08:07 CDT 2013


Module: wine
Branch: master
Commit: f13d8cc373c533714c2ecad11b2e39e4d6a18953
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f13d8cc373c533714c2ecad11b2e39e4d6a18953

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Sep  9 10:00:00 2013 +0400

comctl32: Fix LVS_OWNERDRAWFIXED handling in hittesting.

---

 dlls/comctl32/listview.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index cc90d65..17631b1 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -7500,6 +7500,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
     WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
     RECT rcBox, rcBounds, rcState, rcIcon, rcLabel, rcSearch;
     POINT Origin, Position, opt;
+    BOOL is_fullrow;
     LVITEMW lvItem;
     ITERATOR i;
     INT iItem;
@@ -7623,15 +7624,17 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
     TRACE("rcBounds=%s\n", wine_dbgstr_rect(&rcBounds));
     if (!PtInRect(&rcBounds, opt)) return -1;
 
+    /* That's a special case - row rectangle is used as item rectangle and
+       returned flags contain all item parts. */
+    is_fullrow = (infoPtr->uView == LV_VIEW_DETAILS) && ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) || (infoPtr->dwStyle & LVS_OWNERDRAWFIXED));
+
     if (PtInRect(&rcIcon, opt))
 	lpht->flags |= LVHT_ONITEMICON;
     else if (PtInRect(&rcLabel, opt))
 	lpht->flags |= LVHT_ONITEMLABEL;
     else if (infoPtr->himlState && PtInRect(&rcState, opt))
 	lpht->flags |= LVHT_ONITEMSTATEICON;
-    /* special case for LVS_EX_FULLROWSELECT */
-    if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT &&
-      !(lpht->flags & LVHT_ONITEM))
+    if (is_fullrow && !(lpht->flags & LVHT_ONITEM))
     {
 	lpht->flags = LVHT_ONITEM | LVHT_ABOVE;
     }
@@ -7639,9 +7642,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht,
 	lpht->flags &= ~LVHT_NOWHERE;
     TRACE("lpht->flags=0x%x\n", lpht->flags); 
 
-    if (select && !(infoPtr->uView == LV_VIEW_DETAILS &&
-                    ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) ||
-                     (infoPtr->dwStyle & LVS_OWNERDRAWFIXED))))
+    if (select && !is_fullrow)
     {
         if (infoPtr->uView == LV_VIEW_DETAILS)
         {




More information about the wine-cvs mailing list