From d12c2f8b6ff2ea5c32655d9c23b0bfb10b3f4682 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sun, 29 Mar 2015 10:21:16 +0300 Subject: [PATCH] comctl32/listview: Use defined name instead of magic value. --- dlls/comctl32/listview.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index b3c79760325..081f2a0e064 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -8340,9 +8340,10 @@ static BOOL LISTVIEW_SetColumnWidth(LISTVIEW_INFO *infoPtr, INT nColumn, INT cx) /* set column width only if in report or list mode */ if (infoPtr->uView != LV_VIEW_DETAILS && infoPtr->uView != LV_VIEW_LIST) return FALSE; - /* take care of invalid cx values */ - if(infoPtr->uView == LV_VIEW_DETAILS && cx < -2) cx = LVSCW_AUTOSIZE; - else if (infoPtr->uView == LV_VIEW_LIST && cx < 1) return FALSE; + /* take care of invalid cx values - LVSCW_AUTOSIZE_* values are negative, + with _USEHEADER being the lowest */ + if (infoPtr->uView == LV_VIEW_DETAILS && cx < LVSCW_AUTOSIZE_USEHEADER) cx = LVSCW_AUTOSIZE; + else if (infoPtr->uView == LV_VIEW_LIST && cx <= 0) return FALSE; /* resize all columns if in LV_VIEW_LIST mode */ if(infoPtr->uView == LV_VIEW_LIST)