mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-15 04:54:29 +00:00
fixed: rtf-producer colortable dead index issue
This commit is contained in:
1 parent
68f3c10055
commit
75c102f304
2 files changed
+8
-15
No files matched your search
@@ -569,8 +569,7 @@ var kRgsymRtf = {
|
||||
|
||||
if (_currentRun && fontIndex >= 0 && fontIndex < _fontArray.length)
|
||||
_currentRun.fontName = _fontArray[fontIndex];
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case "fs": // change font size
|
||||
_currentRun.fontSize = parseInt(param) / 2;
|
||||
|
||||
@@ -149,11 +149,10 @@ function _points2twips(a) { return (a) * 20.0; }
|
||||
next,
|
||||
i;
|
||||
|
||||
while ((next = [keyEnum nextObject]) != nil)
|
||||
while ((next = [keyEnum nextObject]) !== nil)
|
||||
{
|
||||
var cn = [colorDict objectForKey:next];
|
||||
|
||||
[list insertObject:next atIndex:[cn intValue] - 1];
|
||||
[list insertObject:[CPColor colorWithCSSString:next] atIndex:[cn intValue]-1];
|
||||
}
|
||||
|
||||
result = [CPString stringWithString:@"{\\colortbl;"];
|
||||
@@ -276,18 +275,13 @@ function _points2twips(a) { return (a) * 20.0; }
|
||||
|
||||
- (int)numberForColor:(CPColor)color
|
||||
{
|
||||
var cn,
|
||||
num = [colorDict objectForKey:color];
|
||||
var num = [colorDict objectForKey:[color cssString]];
|
||||
|
||||
if (num === nil)
|
||||
{
|
||||
cn = [colorDict count];
|
||||
[colorDict setObject:[CPNumber numberWithInt:cn + 1] forKey:color];
|
||||
}
|
||||
else
|
||||
cn = [num intValue];
|
||||
if (!num)
|
||||
[colorDict setObject:num = [CPNumber numberWithInt:[colorDict count] + 1]
|
||||
forKey:[color cssString]];
|
||||
|
||||
return cn + 1;
|
||||
return [num intValue];
|
||||
}
|
||||
|
||||
- (CPString)paragraphStyle:(CPParagraphStyle)paraStyle
|
||||
|
||||
Reference in new issue
Block a user