[PATCH 2/2] comctl32/listview: Include the checkbox in column width calculation
Nikolay Sivov
nsivov at codeweavers.com
Tue Feb 6 06:37:39 CST 2018
From: Mark Jansen <mark.jansen at reactos.org>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/comctl32/listview.c | 2 ++
dlls/comctl32/tests/listview.c | 2 --
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index c085578062..0d7f7ec015 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -8406,6 +8406,8 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx)
if (infoPtr->himlSmall && (nColumn == 0 || (LISTVIEW_GetColumnInfo(infoPtr, nColumn)->fmt & LVCFMT_IMAGE)))
max_cx += infoPtr->iconSize.cx;
max_cx += TRAILING_LABEL_PADDING;
+ if (nColumn == 0 && (infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES))
+ max_cx += GetSystemMetrics(SM_CXSMICON);
}
/* autosize based on listview items width */
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 0506eaa147..c9a165c39c 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -6298,7 +6298,6 @@ static void test_LVSCW_AUTOSIZE(void)
width2 = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
ok(width2 > 0, "Unexpected column width %d.\n", width2);
-todo_wine
ok(width2 > width, "Expected increased column width.\n");
/* Turn off checkboxes. */
@@ -6310,7 +6309,6 @@ todo_wine
width = SendMessageA(hwnd, LVM_GETCOLUMNWIDTH, 0, 0);
ok(width > 0, "Unexpected column width %d.\n", width2);
-todo_wine
ok(width2 > width, "Expected reduced column width.\n");
DestroyWindow(hwnd);
--
2.15.1
More information about the wine-devel
mailing list