Add a check condition for whether the type is slLink.
Signed-off-by: Zhaoyi zhaoyi@uniontech.com
-- v4: comctl32: Make the correct linkid from fun SYSLINK_LinkAtPt.
From: Zhaoyi zhaoyi@uniontech.com
Add a check condition for whether the type is slLink.
Signed-off-by: Zhaoyi zhaoyi@uniontech.com --- dlls/comctl32/syslink.c | 3 ++- dlls/comctl32/tests/syslink.c | 46 ++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 8130bf19641..5302b95dccb 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -1329,7 +1329,8 @@ static PDOC_ITEM SYSLINK_LinkAtPt (const SYSLINK_INFO *infoPtr, const POINT *pt, } return Current; } - id++; + if (Current->Type == slLink) + id++; }
return NULL; diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index d5192c26b5c..976276d7e34 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -30,6 +30,7 @@ #define SYSLINK_SEQ_INDEX 1
static HWND hWndParent; +static int g_linkid;
static struct msg_sequence *sequences[NUM_MSG_SEQUENCE];
@@ -100,7 +101,23 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP }
defwndproc_counter++; - ret = DefWindowProcW(hwnd, message, wParam, lParam); + switch(message) + { + case WM_NOTIFY: + { + NMLINK *nml = ((NMLINK*)lParam); + if (nml && NM_CLICK == nml->hdr.code) + { + g_linkid = nml->item.iLink ; + } + + /* Return zero to indicate default processing */ + return 0; + } + + default: + ret = DefWindowProcW(hwnd, message, wParam, lParam); + } defwndproc_counter--;
return ret; @@ -131,7 +148,7 @@ static HWND create_parent_window(void) return CreateWindowExW(0, L"Syslink test parent class", L"Syslink test parent window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE, - 0, 0, 200, 100, GetDesktopWindow(), + 0, 0, 490, 160, GetDesktopWindow(), NULL, GetModuleHandleW(NULL), NULL); }
@@ -162,8 +179,8 @@ static HWND create_syslink(DWORD style, HWND parent) HWND hWndSysLink;
/* Only Unicode will do here */ - hWndSysLink = CreateWindowExW(0, WC_LINK, L"Head <a href="link1">Name1</a> Middle <a href="link2">Name2</a> Tail", - style, 0, 0, 150, 50, + hWndSysLink = CreateWindowExW(0, WC_LINK, L"Head <a href="link1">Name1</a> Middle <a href="link2">Name2</a> Middle <a href="link3">Name3</a> Tail", + style, 0, 0, 354, 20, parent, NULL, GetModuleHandleW(NULL), NULL); if (!hWndSysLink) return NULL;
@@ -238,6 +255,26 @@ static void test_LM_GETIDEALSIZE(void) DestroyWindow(hwnd); }
+static void test_GETSYSLINKID(void) +{ + HWND hwnd; + LONG ret; + + hwnd = create_syslink(WS_CHILD | WS_TABSTOP | WS_VISIBLE, hWndParent); + ok(hwnd != NULL, "Failed to create SysLink window.\n"); + + //the test point of link3(x=260 y=10). + int point = ((10 << 16) | 260); + + SendMessageA(hwnd, WM_LBUTTONDOWN, 1, (LPARAM)point); + + g_linkid = 0; + SendMessageA(hwnd, WM_LBUTTONUP, 0, (LPARAM)point); + ok(g_linkid == 2, "GETSYSLINKID was not processed correctly!\n"); + + DestroyWindow(hwnd); +} + START_TEST(syslink) { ULONG_PTR ctx_cookie; @@ -266,6 +303,7 @@ START_TEST(syslink) test_create_syslink(); test_LM_GETIDEALHEIGHT(); test_LM_GETIDEALSIZE(); + test_GETSYSLINKID();
DestroyWindow(hWndParent); unload_v6_module(ctx_cookie, hCtx);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=134418
Your paranoid android.
=== w7u_2qxl (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w7u_adm (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w7u_el (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w8 (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w8adm (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w864 (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064v1507 (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064v1809 (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064_tsign (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w10pro64 (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w11pro64 (32 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w7pro64 (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w864 (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064v1507 (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064v1809 (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064_2qxl (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064_adm (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w1064_tsign (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w10pro64 (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w10pro64_en_AE_u8 (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w10pro64_ar (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w10pro64_ja (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w10pro64_zh_CN (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
=== w11pro64_amd (64 bit report) ===
comctl32: syslink.c:207: Test failed: create SysLink (parent): the msg 0x0210 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x0138 should NOT have been sent by DefWindowProc syslink.c:216: Test failed: visible SysLink (parent): the msg 0x004e should NOT have been sent by DefWindowProc
On Tue Jul 4 03:47:43 2023 +0000, Zhao Yi wrote:
Thank you, I'll add a bit of test cases.
Add a test.