[PATCH] LVM_GETITEMRECT with LVIR_LABEL in report mode

Gerard Patel gerard.patel at nerim.net
Sat Feb 16 11:26:48 CST 2002


LVM_GetItemRect does not take text size in account in this case.
it more or less fixes owner drawn fixed mode for listview.
Fixed a test that does not make much sense in current code.
Added also a better trace for Listview_GetColumn.

ChangeLog:

	* dlls/comctl32/listview.c
               LVM_GetItemRect should not take text size in account for
LVIR_LABEL in report mode.
-------------- next part --------------
Index: dlls/comctl32/listview.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/listview.c,v
retrieving revision 1.116
diff -u -r1.116 listview.c
--- dlls/comctl32/listview.c	2002/02/12 18:42:25	1.116
+++ dlls/comctl32/listview.c	2002/02/16 13:27:52
@@ -493,6 +493,21 @@
   return buf;
 }
 
+static char* debuglvcolumn_t(LPLVCOLUMNW lpColumn, BOOL isW)
+{
+  static int index = 0;
+  static char buffers[20][256];
+  char* buf = buffers[index++ % 20];
+  if (lpColumn == NULL) return "(null)";
+  snprintf(buf, 256, "{mask=%x, fmt=%x, cx=%d,"
+           " pszText=%s, cchTextMax=%d, iSubItem=%d}", 
+	   lpColumn->mask, lpColumn->fmt, lpColumn->cx, 
+	   lpColumn->mask & LVCF_TEXT ? lpColumn->pszText == LPSTR_TEXTCALLBACKW ? "(callback)" :
+	     debugstr_tn(lpColumn->pszText, isW, 80): "", 
+	   lpColumn->mask & LVCF_TEXT ? lpColumn->cchTextMax: 0, lpColumn->iSubItem);
+  return buf;
+}
+
 static void LISTVIEW_DumpListview(LISTVIEW_INFO *iP, INT line)
 {
   DWORD dwStyle = GetWindowLongW (iP->hwndSelf, GWL_STYLE);
@@ -916,9 +931,6 @@
   if ((LVS_TYPESTYLEMASK & lStyle) == LVS_NOSORTHEADER)
     FIXME("  LVS_NOSORTHEADER\n");
 
-  if ((LVS_TYPESTYLEMASK & lStyle) == LVS_OWNERDRAWFIXED)
-    FIXME("  LVS_OWNERDRAWFIXED\n");
-
   if (lStyle & LVS_EDITLABELS)
     FIXME("  LVS_EDITLABELS\n");
 
@@ -4887,6 +4899,10 @@
   
   if (lpColumn != NULL)
   {
+
+    TRACE("(hwnd=%x, col=%d, lpColumn=%s, isW=%d)\n", 
+        hwnd, nItem, debuglvcolumn_t(lpColumn, isW), isW);
+
     /* initialize memory */
     ZeroMemory(&hdi, sizeof(hdi));
     
@@ -5670,7 +5686,7 @@
         else
         {
           bResult = TRUE;
-          if (uView & LVS_REPORT)
+          if (uView == LVS_REPORT)
             nLeftPos = lprc->left = ptItem.x + nIndent;
           else 
             nLeftPos = lprc->left = ptItem.x; 
@@ -5683,10 +5699,15 @@
           if (infoPtr->himlSmall != NULL)
             lprc->left += infoPtr->iconSize.cx;
 
-	  nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
-          nLabelWidth += TRAILING_PADDING;
-          if (infoPtr->himlSmall)
-            nLabelWidth += IMAGE_PADDING;
+          if (uView != LVS_REPORT)
+          {
+	    nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
+            nLabelWidth += TRAILING_PADDING;
+            if (infoPtr->himlSmall)
+              nLabelWidth += IMAGE_PADDING;
+          }
+          else
+            nLabelWidth = LISTVIEW_GetColumnWidth(hwnd, 0)-lprc->left;
 	  if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
 	    lprc->right = lprc->left + nLabelWidth;
 	  else
-------------- next part --------------



More information about the wine-patches mailing list