fixed: rtf parser did not propagate paragraph style sometimes

This commit is contained in:
daboe01 committed 2016-06-26 17:05:19 +02:00
1 parent 75c102f304
commit 5afa7e9fc3
2 files changed
+6 -4

No files matched your search

+5 -3
View File
@@ -4,8 +4,8 @@
Copyright (C) 2014 Daniel Boehringer
FIXME: this really sucks and should be redone using a 'real' parser
e.g. using zaach/jison on github
FIXME: this class should be redone using a 'real' parser
* all paragraph spacing information is currently not parsed
@@ -406,9 +406,11 @@ var kRgsymRtf = {
var dict = [_currentRun dictionary];
[_result setAttributes:dict range:_currentRun._range]; // flush previous run
_currentRun.fgColour = [CPColor blackColor];
}
else
_currentRun = [_RTFAttribute new];
_currentRun = [_RTFAttribute new];
_currentRun._range = CPMakeRange(newOffset, 0); // open a new one
}
+1 -1
View File
@@ -286,7 +286,7 @@ function _points2twips(a) { return (a) * 20.0; }
- (CPString)paragraphStyle:(CPParagraphStyle)paraStyle
{
var headerString = [CPString stringWithString:@"\\pard\\plain"],
var headerString = [CPString stringWithString:@"\\pard"],
twips;
if (paraStyle == nil)