Commit f4542cf7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Simplify setting redraw mode flag.

parent 2680b594
...@@ -332,7 +332,7 @@ typedef struct tagLISTVIEW_INFO ...@@ -332,7 +332,7 @@ typedef struct tagLISTVIEW_INFO
/* painting */ /* painting */
BOOL bIsDrawing; /* Drawing in progress */ BOOL bIsDrawing; /* Drawing in progress */
INT nMeasureItemHeight; /* WM_MEASUREITEM result */ INT nMeasureItemHeight; /* WM_MEASUREITEM result */
BOOL bRedraw; /* WM_SETREDRAW switch */ BOOL redraw; /* WM_SETREDRAW switch */
/* misc */ /* misc */
DWORD iVersion; /* CCM_[G,S]ETVERSION */ DWORD iVersion; /* CCM_[G,S]ETVERSION */
...@@ -1706,7 +1706,7 @@ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc) ...@@ -1706,7 +1706,7 @@ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc)
static inline BOOL is_redrawing(const LISTVIEW_INFO *infoPtr) static inline BOOL is_redrawing(const LISTVIEW_INFO *infoPtr)
{ {
return infoPtr->bRedraw; return infoPtr->redraw;
} }
static inline void LISTVIEW_InvalidateRect(const LISTVIEW_INFO *infoPtr, const RECT* rect) static inline void LISTVIEW_InvalidateRect(const LISTVIEW_INFO *infoPtr, const RECT* rect)
...@@ -9465,7 +9465,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -9465,7 +9465,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr->nFocusedItem = -1; infoPtr->nFocusedItem = -1;
infoPtr->nSelectionMark = -1; infoPtr->nSelectionMark = -1;
infoPtr->nHotItem = -1; infoPtr->nHotItem = -1;
infoPtr->bRedraw = TRUE; infoPtr->redraw = TRUE;
infoPtr->bNoItemMetrics = TRUE; infoPtr->bNoItemMetrics = TRUE;
infoPtr->bDoChangeNotify = TRUE; infoPtr->bDoChangeNotify = TRUE;
infoPtr->autoSpacing = TRUE; infoPtr->autoSpacing = TRUE;
...@@ -10948,22 +10948,21 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra ...@@ -10948,22 +10948,21 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra
* *
* PARAMETER(S): * PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure * [I] infoPtr : valid pointer to the listview structure
* [I] bRedraw: state of redraw flag * [I] redraw: state of redraw flag
* *
* RETURN: * RETURN:
* DefWinProc return value * Zero.
*/ */
static LRESULT LISTVIEW_SetRedraw(LISTVIEW_INFO *infoPtr, BOOL bRedraw) static LRESULT LISTVIEW_SetRedraw(LISTVIEW_INFO *infoPtr, BOOL redraw)
{ {
TRACE("infoPtr->bRedraw=%d, bRedraw=%d\n", infoPtr->bRedraw, bRedraw); TRACE("old=%d, new=%d\n", infoPtr->redraw, redraw);
/* we cannot use straight equality here because _any_ non-zero value is TRUE */ if (infoPtr->redraw == !!redraw)
if ((infoPtr->bRedraw && bRedraw) || (!infoPtr->bRedraw && !bRedraw)) return 0; return 0;
infoPtr->bRedraw = bRedraw; if (!(infoPtr->redraw = !!redraw))
return 0;
if(!bRedraw) return 0;
if (is_autoarrange(infoPtr)) if (is_autoarrange(infoPtr))
LISTVIEW_Arrange(infoPtr, LVA_DEFAULT); LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
LISTVIEW_UpdateScroll(infoPtr); LISTVIEW_UpdateScroll(infoPtr);
......
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