aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-03-23 14:37:19 +0000
committerJeremias Maerki <jeremias@apache.org>2007-03-23 14:37:19 +0000
commit6ef73d67bae51fbcf6a3cae9ec876c772ecca9dc (patch)
tree401e4350a7ef54bfb3da85ca9b61bf5f6eae2533 /src
parent26f685652daa9d59317c326270231a81a9290709 (diff)
downloadxmlgraphics-fop-6ef73d67bae51fbcf6a3cae9ec876c772ecca9dc.tar.gz
xmlgraphics-fop-6ef73d67bae51fbcf6a3cae9ec876c772ecca9dc.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/GridUnit.java13
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/RowPainter.java6
2 files changed, 18 insertions, 1 deletions
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,