diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 3eda18d7..0d008181 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -122,10 +122,12 @@ static enum iGmLineType lineType_GmDocument_(const iGmDocument *d, const iRangec | |||
122 | return text_GmLineType; | 122 | return text_GmLineType; |
123 | } | 123 | } |
124 | 124 | ||
125 | static void trimLine_Rangecc_(iRangecc *line, enum iGmLineType type) { | 125 | static void trimLine_Rangecc_(iRangecc *line, enum iGmLineType type, iBool normalize) { |
126 | static const unsigned int skip[max_GmLineType] = { 0, 2, 3, 1, 1, 2, 3, 0 }; | 126 | static const unsigned int skip[max_GmLineType] = { 0, 2, 3, 1, 1, 2, 3, 0 }; |
127 | line->start += skip[type]; | 127 | line->start += skip[type]; |
128 | trim_Rangecc(line); | 128 | if (normalize || (type >= heading1_GmLineType && type <= heading3_GmLineType)) { |
129 | trim_Rangecc(line); | ||
130 | } | ||
129 | } | 131 | } |
130 | 132 | ||
131 | static int lastVisibleRunBottom_GmDocument_(const iGmDocument *d) { | 133 | static int lastVisibleRunBottom_GmDocument_(const iGmDocument *d) { |
@@ -364,7 +366,7 @@ static void doLayout_GmDocument_(iGmDocument *d) { | |||
364 | d->size.x - indents[preformatted_GmLineType] * gap_Text) { | 366 | d->size.x - indents[preformatted_GmLineType] * gap_Text) { |
365 | preFont = preformattedSmall_FontId; | 367 | preFont = preformattedSmall_FontId; |
366 | } | 368 | } |
367 | trimLine_Rangecc_(&line, type); | 369 | trimLine_Rangecc_(&line, type, isNormalized); |
368 | preAltText = line; | 370 | preAltText = line; |
369 | /* TODO: store and link the alt text to this run */ | 371 | /* TODO: store and link the alt text to this run */ |
370 | continue; | 372 | continue; |
@@ -376,9 +378,7 @@ static void doLayout_GmDocument_(iGmDocument *d) { | |||
376 | type = text_GmLineType; | 378 | type = text_GmLineType; |
377 | } | 379 | } |
378 | } | 380 | } |
379 | if (isNormalized) { | 381 | trimLine_Rangecc_(&line, type, isNormalized); |
380 | trimLine_Rangecc_(&line, type); | ||
381 | } | ||
382 | run.font = fonts[type]; | 382 | run.font = fonts[type]; |
383 | /* Remember headings for the document outline. */ | 383 | /* Remember headings for the document outline. */ |
384 | if (type == heading1_GmLineType || type == heading2_GmLineType || type == heading3_GmLineType) { | 384 | if (type == heading1_GmLineType || type == heading2_GmLineType || type == heading3_GmLineType) { |