[colorTable] corrected the output of the colour table, by using a

C array instead of an NSMutableArray.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16000 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2003-02-18 18:59:29 +00:00
parent 0022e44bdd
commit 6d62ef1541

View file

@ -198,7 +198,7 @@
{
NSMutableString *result;
unsigned int count = [colorDict count];
NSMutableArray *list = [NSMutableArray arrayWithCapacity: count];
id list[count];
NSEnumerator *keyEnum = [colorDict keyEnumerator];
id next;
int i;
@ -206,14 +206,14 @@
while ((next = [keyEnum nextObject]) != nil)
{
NSNumber *cn = [colorDict objectForKey: next];
[list insertObject: next atIndex: [cn intValue]-1];
list[[cn intValue]-1] = next;
}
result = (NSMutableString*)[NSMutableString stringWithString: @"{\\colortbl;"];
for (i = 0; i < count; i++)
{
NSColor *color = [[list objectAtIndex: i]
colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
NSColor *color = [list[i] colorUsingColorSpaceName:
NSCalibratedRGBColorSpace];
[result appendString: [NSString stringWithFormat:
@"\\red%d\\green%d\\blue%d;",
(int)([color redComponent]*255),