Fop
  1. Fop
  2. FOP-1563

OpenOffice.org display table incorrectly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.95
    • Fix Version/s: None
    • Component/s: rtf
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      45616

      Description

      I have been tracking problem with incorrecty displayed table in rtf format in openoffice.

      This part openoffice openoffice.org display incorrectly (original document).
      2 columns are displayed as 1 column.

      {\trowd \trpaddt20 \trpaddft3 \clpadt20 \clpadft3 \clbrdrl \ql \cellx5669 \ql \clpadt20 \clpadft3 \clbrdrr \ql \cellx9637 \ql \intbl \ql {{\fs24 547}
      }
      \ql \cell \intbl \ql {{\fs24 Jungmannova}
      }
      \ql \cell \row }

      This part openoffice display correctly (edited document - deleted \ql element before last \cellx element:

      {\trowd \trpaddt20 \trpaddft3 \clpadt20 \clpadft3 \clbrdrl \cellx5669 \clpadt20 \clpadft3 \clbrdrr \cellx9637 \ql \intbl \ql {{\fs24 Soucek Kamil}
      }
      \ql \cell \intbl \ql {{\fs24 organizacní slozka }
      }
      \ql \cell \row }

      There is simple and "ugly" patch for simulating current problem.

          1. Eclipse Workspace Patch 1.0
            #P apache-fop
            Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
            ===================================================================
          • src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (revision 684771)
            +++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (working copy)
            @@ -256,6 +256,8 @@

      //these lines added by Chris Scott, Westinghouse
      //some attributes need to be writting before opening block
      +
      + /*
      if (setCenter)

      { writeControlWord("qc"); }

      else if (setRight)

      { @@ -263,12 +265,13 @@ }

      else

      { writeControlWord("ql"); }

      + */
      writeAttributes (attrib, ITableAttributes.CELL_VERT_ALIGN);

      writeControlWord("cellx" + xPos);

      //TODO Why is this here, right after an alignment command is written (see above)?

      • writeControlWord("ql");
        + /writeControlWord("ql");/

      return xPos;

      Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
      ===================================================================
      — src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java (revision 684771)
      +++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java (working copy)
      @@ -265,10 +265,11 @@

      // write cell's definition
      xPos = rtfcell.writeCellDef(xPos);
      +
      }
      index++; // Added by Boris POUDEROUS on 2002/07/02
      }
      -
      + writeControlWord("ql"); // TEST-CASE
      newLine();
      }

      Question: is there bug in OpenOffice.org rtf parser or bug in rtf generator (rtf
      specification implementation ?)

      TestCase:

      • create rtf document with table with 2 columns at least in row.
      • create rtf document with and without patch
      • open document with openoffice.org (2.4 or 3.x version)
      • compare output - tables

        Activity

        Hide
        Pavel Kysilka added a comment -

        Attached patch fix this problem.

        http://www.biblioscape.com/rtf15_spec.htm#Heading40 (next page)

        Row Formatting
        \trql Left-justifies a table row with respect to its containing column.
        \trqr Right-justifies a table row with respect to its containing column.
        \trqc Centers a table row with respect to its containing column.

        tested by OpenOffice 3.x , Abiword 2.6.4; Linux OS.

        Show
        Pavel Kysilka added a comment - Attached patch fix this problem. http://www.biblioscape.com/rtf15_spec.htm#Heading40 (next page) Row Formatting \trql Left-justifies a table row with respect to its containing column. \trqr Right-justifies a table row with respect to its containing column. \trqc Centers a table row with respect to its containing column. tested by OpenOffice 3.x , Abiword 2.6.4; Linux OS.
        Hide
        Pavel Kysilka added a comment -

        Attachment cell_definition_OOffice.patch has been added with description: row formating patch - fix for OpenOffice

        Show
        Pavel Kysilka added a comment - Attachment cell_definition_OOffice.patch has been added with description: row formating patch - fix for OpenOffice
        Hide
        Jeremias Maerki added a comment -

        Patch verified with Word 2007 Viewer and OpenOffice 2.4. Patch applied to FOP Trunk:
        http://svn.apache.org/viewvc?rev=693742&view=rev

        Thanks a lot, Pavel. Sorry for the delay.

        Show
        Jeremias Maerki added a comment - Patch verified with Word 2007 Viewer and OpenOffice 2.4. Patch applied to FOP Trunk: http://svn.apache.org/viewvc?rev=693742&view=rev Thanks a lot, Pavel. Sorry for the delay.
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

          People

          • Assignee:
            fop-dev
            Reporter:
            Pavel Kysilka
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development