Bug 42374 - [PATCH] List label and bodyindentation incorrect in RTF
Summary: [PATCH] List label and bodyindentation incorrect in RTF
Status: NEW
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: rtf (show other bugs)
Version: 0.93
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-05-09 16:53 UTC by David Lai
Modified: 2012-04-11 06:17 UTC (History)
1 user (show)



Attachments
Patch proposal (7.83 KB, patch)
2008-11-25 02:12 UTC, Max Aster
Details | Diff
Result of the posted fo (3.31 KB, application/msword)
2008-11-25 02:13 UTC, Max Aster
Details
Another small test fo (10.84 KB, application/octet-stream)
2008-11-25 02:14 UTC, Max Aster
Details
RTF after patch applied (3.64 KB, application/msword)
2008-11-25 05:21 UTC, Chris Bowditch
Details
Fo file (3.32 KB, application/octet-stream)
2008-11-25 05:40 UTC, Max Aster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Lai 2007-05-09 16:53:34 UTC
I'm using FOP 0.93 to convert FO to RTF. The FO has a numbered list inside a 
table cell as below. The list item label and body in the generated RTF are not 
indented correctly according to the "start-indent" settings in the FO. It 
looks like the first indent is hard coded with a value 360 and the FO "start-
indent" setting is being ignored in RtfListItem.java.

<fo:table end-indent="-5.4pt" start-indent="-5.4pt" table-layout="fixed">
<fo:table-column column-width="95.4pt"/>
<fo:table-column column-width="369pt"/>
<fo:table-body end-indent="0pt" start-indent="0pt">
<fo:table-row>
<fo:table-cell padding-left="5.4pt" padding-right="5.4pt">
<fo:block line-height="13.7pt" orphans="1" widows="1">
<fo:leader line-height="13.7pt"/>
</fo:block>
</fo:table-cell>
<fo:table-cell padding-left="5.4pt" padding-right="5.4pt">
<fo:list-block>
<fo:list-item orphans="1" widows="1">
<fo:list-item-label end-indent="0pt" start-indent="14.2pt">
<fo:block line-height="13.7pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Arial, sans-serif" font-size="12pt">
i.</fo:inline>
</fo:block>
</fo:list-item-label>
<fo:list-item-body end-indent="0pt" start-indent="45.35pt">
<fo:block line-height="13.7pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Arial, sans-serif" font-size="12pt">
List item 1</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item orphans="1" widows="1">
<fo:list-item-label end-indent="0pt" start-indent="14.2pt">
<fo:block line-height="13.7pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Arial, sans-serif" font-size="12pt">
ii.</fo:inline>
</fo:block>
</fo:list-item-label>
<fo:list-item-body end-indent="0pt" start-indent="45.35pt">
<fo:block line-height="13.7pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Arial, sans-serif" font-size="12pt">
List item 2</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
<fo:list-item orphans="1" widows="1">
<fo:list-item-label end-indent="0pt" start-indent="14.2pt">
<fo:block line-height="13.7pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Arial, sans-serif" font-size="12pt">
iii.</fo:inline>
</fo:block>
</fo:list-item-label>
<fo:list-item-body end-indent="0pt" start-indent="45.35pt">
<fo:block line-height="13.7pt" text-align="start" text-indent="0pt">
<fo:inline font-family="Arial, sans-serif" font-size="12pt">
List item 3</fo:inline>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<fo:block line-height="13.7pt" orphans="1" widows="1">
<fo:leader line-height="13.7pt"/>
</fo:block>
<fo:block line-height="13.7pt" orphans="1" widows="1">
<fo:leader line-height="13.7pt"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
Comment 1 Max Aster 2008-11-25 02:12:36 UTC
Created attachment 22932 [details]
Patch proposal

Changed several things, also in RtfListItem.java. 
The attribute "provisional-distance-between-starts" should now also be handled correctly.
Comment 2 Max Aster 2008-11-25 02:13:48 UTC
Created attachment 22933 [details]
Result of the posted fo
Comment 3 Max Aster 2008-11-25 02:14:22 UTC
Created attachment 22934 [details]
Another small test fo
Comment 4 Chris Bowditch 2008-11-25 03:44:33 UTC
Thanks for the patch, I'm processing it ATM. So far I found that you've made some minor mistakes in following code guidelines. Specifically { brace should appear on same line as IF test and whitespace hasn't been used inbetween operators in the IF test.
Comment 5 Chris Bowditch 2008-11-25 05:21:19 UTC
Created attachment 22941 [details]
RTF after patch applied

Are you sure that the patch is correct? After I apply the patch and correct the minor checkstyle issues, the RTF generated is very different from the one you attached. Specifically I don't see the list labels at all when viewing the RTF in Word.
Comment 6 Max Aster 2008-11-25 05:40:07 UTC
Created attachment 22942 [details]
Fo file

Sorry for the guideline mistakes.
To be generated correctly i had to remove the newlines between the fo:block, fo:inline and the text inside the list-item-label.
Comment 7 Chris Bowditch 2008-11-25 09:04:24 UTC
Thanks for sending the FO. I thought I'd corrected the whitespace but I guess I must have missed something.

The first test file then Renders as expected, but the second test file gave me some odd results in the PDF Renderer, which I was comparing to the RTF Result. I raised bug 46294 against List Indentations in PDF.

However, I don't think the RTF Renderer behaves correctly as per the specification with your patch applied. Certainly the patch is an improvement to the existing code, but it seems to compute the indents incorrectly, e.g. for example the start-body() function should be based on the indent of the list-block + provisional-distance-between-starts and not take into account the start-indent on list-item.
Comment 8 Glenn Adams 2012-04-07 01:41:58 UTC
resetting P2 open bugs to P3 pending further review
Comment 9 Glenn Adams 2012-04-11 03:21:58 UTC
increase priority for bugs with a patch
Comment 10 Glenn Adams 2012-04-11 06:17:18 UTC
change status from ASSIGNED to NEW for consistency