changeset 105:ad95fc623ff3

Some changes to the container optimization code.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 04 Sep 2002 09:05:19 +0000
parents 2892fe8a023e
children 4b6799f3dbbc
files win/dw.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Sat Aug 24 07:51:46 2002 +0000
+++ b/win/dw.c	Wed Sep 04 09:05:19 2002 +0000
@@ -46,6 +46,9 @@
 HICON lookup[200];
 HIMAGELIST hSmall  = 0, hLarge = 0;
 
+/* Special flag used for internal tracking */
+#define DW_CFA_RESERVED (1 << 30)
+
 #define THREAD_LIMIT 128
 COLORREF _foreground[THREAD_LIMIT];
 COLORREF _background[THREAD_LIMIT];
@@ -5498,11 +5501,14 @@
 {
 	ContainerInfo *cinfo = (ContainerInfo *)GetWindowLong(handle, GWL_USERDATA);
 	int z, l = 0;
-	unsigned long *tempflags = malloc(sizeof(unsigned long) * (count + 2));
+	unsigned long *tempflags = calloc(sizeof(unsigned long), count + 2);
 	LV_COLUMN lvc;
 
 	if(separator == -1)
+	{
+		tempflags[0] = DW_CFA_RESERVED;
 		l = 1;
+	}
 
 	memcpy(&tempflags[l], flags, sizeof(unsigned long) * count);
 	tempflags[count + l] = 0;
@@ -6000,6 +6006,9 @@
 
 				if(ListView_GetColumn(handle, z, &lvc))
 					columns[z] = ListView_GetStringWidth(handle, lvc.pszText);
+
+				if(flags[z] & DW_CFA_RESERVED)
+					columns[z] += 20;
 			}
 		}