Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-1563

OpenOffice.org display table incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 0.95
    • None
    • renderer/rtf
    • None
    • Operating System: Linux
      Platform: PC
    • 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

      Attachments

        1. cell_definition_OOffice.patch
          0.9 kB
          Pavel Kysilka

        Activity

          People

            fop-dev@xmlgraphics.apache.org fop-dev
            goldenfish@linuxsoft.cz Pavel Kysilka
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: