Listview: GetItemSpacing fix

Francois Gouget fgouget at free.fr
Mon Apr 16 03:01:05 CDT 2001


   My goal is to fix GetItemRect but I found problems in GetItemSpacing
and GetItemPosition. Starting with GetItemSpacing...


Changelog:

 * dlls/comctl32/listview.c
   GetItemSpacing(true): Return the default item spacing if the view is
LVS_ICON, and the current 'item size' otherwise.

--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
        War doesn't determine who's right.  War determines who's left.
-------------- next part --------------
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /home/cvs/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.102
diff -u -r1.102 listview.c
--- dlls/comctl32/listview.c	2001/04/04 18:25:46	1.102
+++ dlls/comctl32/listview.c	2001/04/16 03:58:56
@@ -5756,10 +5792,16 @@
   }
   else
   {
-    /* TODO: need to store width of smallicon item */
-    lResult = MAKELONG(0, infoPtr->nItemHeight);
-  }  
-  
+    LONG style = GetWindowLongA(hwnd, GWL_STYLE);
+    if ((style & LVS_TYPEMASK) == LVS_ICON)
+    {
+      lResult = MAKELONG(DEFAULT_COLUMN_WIDTH, GetSystemMetrics(SM_CXSMICON)+HEIGHT_PADDING);
+    }
+    else
+    {
+      lResult = MAKELONG(infoPtr->nItemWidth, infoPtr->nItemHeight);
+    }
+  }
   return lResult;
 }
 


More information about the wine-patches mailing list