Nikolay Sivov : comctl32/listview: Introduce a way to update cached column rectangles from Header.

Alexandre Julliard julliard at winehq.org
Tue Aug 4 12:24:55 CDT 2009


Module: wine
Branch: master
Commit: 9576fb1836c26d5c3a2e274d0dbc4ce58664b2af
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9576fb1836c26d5c3a2e274d0dbc4ce58664b2af

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Tue Aug  4 00:30:08 2009 +0400

comctl32/listview: Introduce a way to update cached column rectangles from Header.

---

 dlls/comctl32/listview.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 2d35992..0a862c8 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -290,6 +290,7 @@ typedef struct tagLISTVIEW_INFO
   HDPA hdpaPosX;		/* maintains the (X, Y) coordinates of the */
   HDPA hdpaPosY;		/* items in LVS_ICON, and LVS_SMALLICON modes */
   HDPA hdpaColumns;		/* array of COLUMN_INFO pointers */
+  BOOL colRectsDirty;		/* trigger column rectangles requery from header */
   POINT currIconPos;		/* this is the position next icon will be placed */
   PFNLVCOMPARE pfnCompare;
   LPARAM lParamSort;
@@ -1483,6 +1484,21 @@ static inline COLUMN_INFO * LISTVIEW_GetColumnInfo(const LISTVIEW_INFO *infoPtr,
 
     if (nSubItem == 0 && DPA_GetPtrCount(infoPtr->hdpaColumns) == 0) return &mainItem;
     assert (nSubItem >= 0 && nSubItem < DPA_GetPtrCount(infoPtr->hdpaColumns));
+
+    /* update cached column rectangles */
+    if (infoPtr->colRectsDirty)
+    {
+        COLUMN_INFO *info;
+        LISTVIEW_INFO *Ptr = (LISTVIEW_INFO*)infoPtr;
+        INT i;
+
+        for (i = 0; i < DPA_GetPtrCount(infoPtr->hdpaColumns); i++) {
+            info = DPA_GetPtr(infoPtr->hdpaColumns, i);
+            SendMessageW(infoPtr->hwndHeader, HDM_GETITEMRECT, i, (LPARAM)&info->rcHeader);
+        }
+        Ptr->colRectsDirty = FALSE;
+    }
+
     return DPA_GetPtr(infoPtr->hdpaColumns, nSubItem);
 }
 
@@ -8643,6 +8659,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
   infoPtr->xTrackLine = -1;  /* no track line */
   infoPtr->itemEdit.fEnabled = FALSE;
   infoPtr->iVersion = COMCTL32_VERSION;
+  infoPtr->colRectsDirty = FALSE;
 
   /* get default font (icon title) */
   SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0);




More information about the wine-cvs mailing list