FOP
  1. FOP
  2. FOP-1434

table-cell don't render when using number-rows-spanned

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: layout/unqualified
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • External issue ID:
      43633

      Description

      Hi,

      When creating a table, five columns by 6 rows, if the first cell on row two
      (cell 2-1) has a number-rows-spanned=5, the cell 1-1 is not rendered.

      See FO included to reproduce.

      Guillaume Levrero.

      1. table_row-span_empty-row.fo
        2 kB
        Vincent Hennebert
      2. BUG-number-row-spanned.fo
        19 kB
        Guillaume Levrero

        Activity

        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
        Hide
        Vincent Hennebert added a comment -

        This is fixed in rev. 605295 of the Trunk.

        Show
        Vincent Hennebert added a comment - This is fixed in rev. 605295 of the Trunk.
        Hide
        Vincent Hennebert added a comment -

        Attachment table_row-span_empty-row.fo has been added with description: A minimal file to reproduce the problem

        Show
        Vincent Hennebert added a comment - Attachment table_row-span_empty-row.fo has been added with description: A minimal file to reproduce the problem
        Hide
        Vincent Hennebert added a comment -

        Hi Guillaume,

        Thanks for reporting the bug. Although your test table is a bit odd since it
        contains an empty row (row 2). You can work around the problem by adding an
        empty cell in the row that contains the spanning cell:
        <fo:table-cell>
        <fo:block/>
        </fo:table-cell>
        That way you will get the expected result.

        For devs: at least this test is a showcase for the strange loop in
        RowPainter.addAreasForCell
        Since row 2 is empty (contains no cell ending on this row), no
        TableContentPosition is created for this row. Thus, in
        RowPainter.handleTableContentPosition, the first test is never triggered for row
        2. So in addAreasAndFlushRow, the yoffset of row 2 is not recorded. And in
        addAreasForCell, when the offset of the first row spanned by the spanning cell
        is searched, it's not found so the while loop is triggered and the offset of the
        previous row is returned instead.
        As a consequence, the spanning cell, starting on row 2, gets the same offset as
        cell 1.1, and overrides it.

        I'll have a look at this later on, since the whole code handling empty/missing
        cells needs some touch-up anyway.

        Vincent

        Show
        Vincent Hennebert added a comment - Hi Guillaume, Thanks for reporting the bug. Although your test table is a bit odd since it contains an empty row (row 2). You can work around the problem by adding an empty cell in the row that contains the spanning cell: <fo:table-cell> <fo:block/> </fo:table-cell> That way you will get the expected result. For devs: at least this test is a showcase for the strange loop in RowPainter.addAreasForCell Since row 2 is empty (contains no cell ending on this row), no TableContentPosition is created for this row. Thus, in RowPainter.handleTableContentPosition, the first test is never triggered for row 2. So in addAreasAndFlushRow, the yoffset of row 2 is not recorded. And in addAreasForCell, when the offset of the first row spanned by the spanning cell is searched, it's not found so the while loop is triggered and the offset of the previous row is returned instead. As a consequence, the spanning cell, starting on row 2, gets the same offset as cell 1.1, and overrides it. I'll have a look at this later on, since the whole code handling empty/missing cells needs some touch-up anyway. Vincent
        Hide
        Guillaume Levrero added a comment -

        Attachment BUG-number-row-spanned.fo has been added with description: FO to repoduce bug.

        Show
        Guillaume Levrero added a comment - Attachment BUG-number-row-spanned.fo has been added with description: FO to repoduce bug.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development