From 6ef73d67bae51fbcf6a3cae9ec876c772ecca9dc Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 23 Mar 2007 14:37:19 +0000 Subject: Some more comments for RowPainter. Additional test that checks that no cell paints more than one area in that case. Because if you remove one or more of the checks now newly commented, you get multiple areas. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@521744 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/layoutmgr/table/GridUnit.java | 13 +++++++++++++ src/java/org/apache/fop/layoutmgr/table/RowPainter.java | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/java/org/apache/fop') diff --git a/src/java/org/apache/fop/layoutmgr/table/GridUnit.java b/src/java/org/apache/fop/layoutmgr/table/GridUnit.java index b472acf49..beb41f35b 100644 --- a/src/java/org/apache/fop/layoutmgr/table/GridUnit.java +++ b/src/java/org/apache/fop/layoutmgr/table/GridUnit.java @@ -345,11 +345,24 @@ public class GridUnit { buffer.append("GridUnit:"); if (colSpanIndex > 0) { buffer.append(" colSpan=").append(colSpanIndex); + if (isLastGridUnitColSpan()) { + buffer.append("(last)"); + } } if (rowSpanIndex > 0) { buffer.append(" rowSpan=").append(rowSpanIndex); + if (isLastGridUnitRowSpan()) { + buffer.append("(last)"); + } } buffer.append(" startCol=").append(startCol); + if (!isPrimary() && getPrimary() != null) { + buffer.append(" primary=").append(getPrimary().getStartRow()); + buffer.append("/").append(getPrimary().getStartCol()); + if (getPrimary().getCell() != null) { + buffer.append(" id=" + getPrimary().getCell().getId()); + } + } buffer.append(" flags=").append(Integer.toBinaryString(flags)); return buffer.toString(); } diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java index 3e298d71c..1c640f973 100644 --- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java +++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java @@ -266,11 +266,15 @@ class RowPainter { PrimaryGridUnit gu = primaryGridUnits[i]; if (gu == null && !currentGU.isEmpty() - && currentGU.getColSpanIndex() == 0 + && currentGU.getColSpanIndex() == 0 && currentGU.isLastGridUnitColSpan() && (forcedFlush || currentGU.isLastGridUnitRowSpan())) { + //Grid unit to be painted is not the primary + //the checks above make sure no cell is painted more than once gu = currentGU.getPrimary(); } + + //gu can still be null if we're talking about an EmptyGridUnit, for example if (gu != null) { addAreasForCell(gu, start[i], end[i], lastRow, -- cgit v1.2.3