comctl32/header: Fix hittesting flags, extend tests a bit
Nikolay Sivov
bunglehead at gmail.com
Tue Jul 14 15:17:07 CDT 2009
Changelog:
- Fix hittesting flags, extend tests a bit
>From 1ae2067c538e76cc22db0a535d00d0dc032e4d10 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed, 15 Jul 2009 00:11:12 +0400
Subject: Fix hittesting flags, extend tests a bit
---
dlls/comctl32/header.c | 6 ++++--
dlls/comctl32/tests/header.c | 11 ++++++-----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 1ee58cd..7c8f161 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -1224,10 +1224,12 @@ HEADER_GetUnicodeFormat (const HEADER_INFO *infoPtr)
static LRESULT
HEADER_HitTest (const HEADER_INFO *infoPtr, LPHDHITTESTINFO phti)
{
+ UINT outside = HHT_NOWHERE | HHT_ABOVE | HHT_BELOW | HHT_TOLEFT | HHT_TORIGHT;
+
HEADER_InternalHitTest (infoPtr, &phti->pt, &phti->flags, &phti->iItem);
- if (phti->flags == HHT_NOWHERE)
- return -1;
+ if (phti->flags & outside)
+ return phti->iItem = -1;
else
return phti->iItem;
}
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index bf3960e..611433e 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -904,6 +904,7 @@ static void test_hdm_hittest(HWND hParent)
retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
expect(0, retVal);
expect(0, hdHitTestInfo.iItem);
+ expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
pt.x = secondItemRightBoundary - 1;
pt.y = bottomBoundary - 1;
@@ -911,15 +912,15 @@ static void test_hdm_hittest(HWND hParent)
retVal = SendMessage(hChild, HDM_HITTEST, 1, (LPARAM) &hdHitTestInfo);
expect(1, retVal);
expect(1, hdHitTestInfo.iItem);
+ expect(HHT_ONDIVIDER, hdHitTestInfo.flags);
pt.x = secondItemRightBoundary;
pt.y = bottomBoundary + 1;
hdHitTestInfo.pt = pt;
- todo_wine
- {
- retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
- expect(-1, retVal);
- }
+ retVal = SendMessage(hChild, HDM_HITTEST, 0, (LPARAM) &hdHitTestInfo);
+ expect(-1, retVal);
+ expect(-1, hdHitTestInfo.iItem);
+ expect(HHT_BELOW, hdHitTestInfo.flags);
ok_sequence(sequences, HEADER_SEQ_INDEX, hittest_seq, "hittest sequence testing", FALSE);
--
1.5.6.5
More information about the wine-patches
mailing list