# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1031130319 0 # Node ID ad95fc623ff3524a5a7095e134d494ae5b4b97d9 # Parent 2892fe8a023ef1900f6c069ad5231cb49ee3bc09 Some changes to the container optimization code. diff -r 2892fe8a023e -r ad95fc623ff3 win/dw.c --- 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; } }