Commit 7fb21244 authored by Guy Albertelli's avatar Guy Albertelli Committed by Alexandre Julliard

listview: Correct return value from LVM_GETORIGIN including tests for this.

Tests to validate return value of the LVM_GETORIGIN message and fix our implementation.
parent e85fa81f
...@@ -9632,6 +9632,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -9632,6 +9632,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case LVM_GETORIGIN: case LVM_GETORIGIN:
if (!lParam) return FALSE; if (!lParam) return FALSE;
if ((infoPtr->dwStyle & LVS_TYPEMASK) == LVS_REPORT ||
(infoPtr->dwStyle & LVS_TYPEMASK) == LVS_LIST) return FALSE;
LISTVIEW_GetOrigin(infoPtr, (LPPOINT)lParam); LISTVIEW_GetOrigin(infoPtr, (LPPOINT)lParam);
return TRUE; return TRUE;
......
...@@ -1076,6 +1076,54 @@ static void test_item_position(void) ...@@ -1076,6 +1076,54 @@ static void test_item_position(void)
DestroyWindow(hwnd); DestroyWindow(hwnd);
} }
static void test_getorigin(void)
{
/* LVM_GETORIGIN */
HWND hwnd;
DWORD r;
POINT position;
position.x = position.y = 0;
hwnd = create_custom_listview_control(LVS_ICON);
ok(hwnd != NULL, "failed to create a listview window\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
trace("test get origin results\n");
r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position);
expect(TRUE, r);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
DestroyWindow(hwnd);
hwnd = create_custom_listview_control(LVS_SMALLICON);
ok(hwnd != NULL, "failed to create a listview window\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
trace("test get origin results\n");
r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position);
expect(TRUE, r);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
DestroyWindow(hwnd);
hwnd = create_custom_listview_control(LVS_LIST);
ok(hwnd != NULL, "failed to create a listview window\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
trace("test get origin results\n");
r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position);
expect(FALSE, r);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
DestroyWindow(hwnd);
hwnd = create_custom_listview_control(LVS_REPORT);
ok(hwnd != NULL, "failed to create a listview window\n");
flush_sequences(sequences, NUM_MSG_SEQUENCES);
trace("test get origin results\n");
r = SendMessage(hwnd, LVM_GETORIGIN, 0, (LPARAM)&position);
expect(FALSE, r);
flush_sequences(sequences, NUM_MSG_SEQUENCES);
DestroyWindow(hwnd);
}
START_TEST(listview) START_TEST(listview)
{ {
HMODULE hComctl32; HMODULE hComctl32;
...@@ -1111,4 +1159,5 @@ START_TEST(listview) ...@@ -1111,4 +1159,5 @@ START_TEST(listview)
test_item_count(); test_item_count();
test_item_position(); test_item_position();
test_columns(); test_columns();
test_getorigin();
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment