Nikolay Sivov : comctl32/listview: Don't query header if it isn't created.
Alexandre Julliard
julliard at winehq.org
Thu Oct 22 10:39:56 CDT 2009
Module: wine
Branch: master
Commit: aaec03347d3ab19d8322742095f66e257647f4d7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aaec03347d3ab19d8322742095f66e257647f4d7
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Thu Oct 22 00:29:00 2009 +0400
comctl32/listview: Don't query header if it isn't created.
---
dlls/comctl32/listview.c | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 3744e10..4ec8628 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10326,19 +10326,23 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
}
else if (infoPtr->uView == LV_VIEW_DETAILS)
{
- HDLAYOUT hl;
- WINDOWPOS wp;
-
- hl.prc = &infoPtr->rcList;
- hl.pwpos = ℘
- SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
- TRACE(" wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy);
- SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy,
- wp.flags | ((infoPtr->dwStyle & LVS_NOCOLUMNHEADER)
- ? SWP_HIDEWINDOW : SWP_SHOWWINDOW));
- TRACE(" after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy);
-
- infoPtr->rcList.top = max(wp.cy, 0);
+ /* if control created invisible header isn't created */
+ if (infoPtr->hwndHeader)
+ {
+ HDLAYOUT hl;
+ WINDOWPOS wp;
+
+ hl.prc = &infoPtr->rcList;
+ hl.pwpos = ℘
+ SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
+ TRACE(" wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy);
+ SetWindowPos(wp.hwnd, wp.hwndInsertAfter, wp.x, wp.y, wp.cx, wp.cy,
+ wp.flags | ((infoPtr->dwStyle & LVS_NOCOLUMNHEADER)
+ ? SWP_HIDEWINDOW : SWP_SHOWWINDOW));
+ TRACE(" after SWP wp=%d,%d (%dx%d)\n", wp.x, wp.y, wp.cx, wp.cy);
+
+ infoPtr->rcList.top = max(wp.cy, 0);
+ }
infoPtr->rcList.top += (infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) ? 2 : 0;
}
More information about the wine-cvs
mailing list