mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
[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:
parent
0022e44bdd
commit
6d62ef1541
1 changed files with 4 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue