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 | 14 ++++++++------ dlls/comctl32/tests/syslink.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 8130bf19641..6af516ea1e6 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -1320,16 +1320,18 @@ static PDOC_ITEM SYSLINK_LinkAtPt (const SYSLINK_INFO *infoPtr, const POINT *pt,
LIST_FOR_EACH_ENTRY(Current, &infoPtr->Items, DOC_ITEM, entry) { - if((Current->Type == slLink) && SYSLINK_PtInDocItem(Current, *pt) && - (!MustBeEnabled || (Current->u.Link.state & LIS_ENABLED))) + if(Current->Type == slLink) { - if(LinkId != NULL) + if(SYSLINK_PtInDocItem(Current, *pt) && (!MustBeEnabled || (Current->u.Link.state & LIS_ENABLED))) { - *LinkId = id; + if(LinkId != NULL) + { + *LinkId = id; + } + return Current; } - return Current; + id++; } - id++; }
return NULL; diff --git a/dlls/comctl32/tests/syslink.c b/dlls/comctl32/tests/syslink.c index 5acae2aee91..2c770143cee 100644 --- a/dlls/comctl32/tests/syslink.c +++ b/dlls/comctl32/tests/syslink.c @@ -271,7 +271,7 @@ static void test_GETSYSLINKID(void)
g_linkid = 0; SendMessageA(hwnd, WM_LBUTTONUP, 0, (LPARAM)point); - todo_wine ok(g_linkid == 2, "GETSYSLINKID was not processed correctly!\n"); + ok(g_linkid == 2, "GETSYSLINKID was not processed correctly!\n");
DestroyWindow(hwnd); }