Mercurial > dwindows
comparison mac/dw.m @ 940:b5ae9cf15f68
Fix for returning wrong extension in _dw_get_image_extension; only worked for .ico files
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 27 Apr 2011 09:59:14 +0000 |
parents | 0ba3003272a1 |
children | 18f194e1d71d |
comparison
equal
deleted
inserted
replaced
939:0ba3003272a1 | 940:b5ae9cf15f68 |
---|---|
93 break; | 93 break; |
94 } | 94 } |
95 } | 95 } |
96 if ( found_ext == 1 ) | 96 if ( found_ext == 1 ) |
97 { | 97 { |
98 return image_exts[found_ext]; | 98 return image_exts[i]; |
99 } | 99 } |
100 return NULL; | 100 return NULL; |
101 } | 101 } |
102 | 102 |
103 unsigned long _get_color(unsigned long thiscolor) | 103 unsigned long _get_color(unsigned long thiscolor) |
7200 } | 7200 } |
7201 /* Handle destroying a control or box */ | 7201 /* Handle destroying a control or box */ |
7202 else if([object isKindOfClass:[DWBox class]] || [object isKindOfClass:[NSControl class]]) | 7202 else if([object isKindOfClass:[DWBox class]] || [object isKindOfClass:[NSControl class]]) |
7203 { | 7203 { |
7204 DWBox *parent = (DWBox *)[object superview]; | 7204 DWBox *parent = (DWBox *)[object superview]; |
7205 | 7205 |
7206 if([parent isKindOfClass:[DWBox class]]) | 7206 if([parent isKindOfClass:[DWBox class]]) |
7207 { | 7207 { |
7208 Box *thisbox = [parent box]; | 7208 Box *thisbox = [parent box]; |
7209 int z, index = -1; | 7209 int z, index = -1; |
7210 Item *tmpitem, *thisitem = thisbox->items; | 7210 Item *tmpitem, *thisitem = thisbox->items; |
7211 | 7211 |
7212 [object removeFromSuperview]; | 7212 [object removeFromSuperview]; |
7213 /* Do we need to release? | 7213 /* Do we need to release? |
7214 * [object release]; | 7214 * [object release]; |
7215 */ | 7215 */ |
7216 | 7216 |
7217 for(z=0;z<thisbox->count;z++) | 7217 for(z=0;z<thisbox->count;z++) |
7218 { | 7218 { |
7219 if(thisitem[z].hwnd == handle) | 7219 if(thisitem[z].hwnd == handle) |
7220 index = z; | 7220 index = z; |
7221 } | 7221 } |
7222 | 7222 |
7223 if(index == -1) | 7223 if(index == -1) |
7224 { | 7224 { |
7225 DW_MUTEX_UNLOCK; | 7225 DW_MUTEX_UNLOCK; |
7226 return 0; | 7226 return 0; |
7227 } | 7227 } |
7228 | 7228 |
7229 tmpitem = malloc(sizeof(Item)*(thisbox->count-1)); | 7229 tmpitem = malloc(sizeof(Item)*(thisbox->count-1)); |
7230 | 7230 |
7231 /* Copy all but the current entry to the new list */ | 7231 /* Copy all but the current entry to the new list */ |
7232 for(z=0;z<index;z++) | 7232 for(z=0;z<index;z++) |
7233 { | 7233 { |
7234 tmpitem[z] = thisitem[z]; | 7234 tmpitem[z] = thisitem[z]; |
7235 } | 7235 } |
7236 for(z=index+1;z<thisbox->count;z++) | 7236 for(z=index+1;z<thisbox->count;z++) |
7237 { | 7237 { |
7238 tmpitem[z-1] = thisitem[z]; | 7238 tmpitem[z-1] = thisitem[z]; |
7239 } | 7239 } |
7240 | 7240 |
7241 thisbox->items = tmpitem; | 7241 thisbox->items = tmpitem; |
7242 free(thisitem); | 7242 free(thisitem); |
7243 thisbox->count--; | 7243 thisbox->count--; |
7244 } | 7244 } |
7245 } | 7245 } |
7246 DW_MUTEX_UNLOCK; | 7246 DW_MUTEX_UNLOCK; |
7247 return 0; | 7247 return 0; |
7248 } | 7248 } |