fixed: rtf-producer colortable dead index issue

This commit is contained in:
daboe01 committed 2016-06-25 21:23:35 +02:00
1 parent 68f3c10055
commit 75c102f304
2 files changed
+8 -15

No files matched your search

+1 -2
View File
@@ -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;
+7 -13
View File
@@ -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