invalidate all affected rows when reconciling cells with vertical span

Signed-off-by: Florian Thienel <florian@thienel.org>
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java
index f7393ff..938532f 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java
@@ -10,8 +10,8 @@
  *******************************************************************************/
 package org.eclipse.vex.core.internal.boxes;
 
+import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 
 import org.eclipse.vex.core.internal.core.Graphics;
 import org.eclipse.vex.core.internal.core.Rectangle;
@@ -34,6 +34,7 @@
 	private int verticalSpan = 1;
 
 	private GridArea gridArea;
+	private TableLayoutGrid layoutGrid;
 
 	private int naturalHeight;
 	private int usedHeight;
@@ -164,6 +165,14 @@
 		this.gridArea = gridArea;
 	}
 
+	public TableLayoutGrid getLayoutGrid() {
+		return layoutGrid;
+	}
+
+	public void setLayoutGrid(final TableLayoutGrid layoutGrid) {
+		this.layoutGrid = layoutGrid;
+	}
+
 	public int calculateNaturalHeight(final Graphics graphics, final int width) {
 		naturalHeight = 0;
 		if (component == null) {
@@ -202,7 +211,13 @@
 
 		component.setPosition(0, 0);
 		adjustComponentHeight();
-		return Collections.singleton(getParent());
+
+		final ArrayList<IBox> invalidatedRows = new ArrayList<IBox>();
+		for (int row = gridArea.startRow; row <= gridArea.endRow; row += 1) {
+			invalidatedRows.add(layoutGrid.getRow(row));
+		}
+
+		return invalidatedRows;
 	}
 
 	@Override
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java
index f075bb0..cd40f5f 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java
@@ -135,6 +135,7 @@
 		}
 		occupy(area, cell);
 		cell.setGridArea(area);
+		cell.setLayoutGrid(this);
 		updateNextColumn();
 		return true;
 	}
@@ -143,6 +144,7 @@
 		final GridArea area = new GridArea(currentRow, nextColumn, currentRow + cell.getVerticalSpan() - 1, nextColumn);
 		occupy(area, cell);
 		cell.setGridArea(area);
+		cell.setLayoutGrid(this);
 		updateNextColumn();
 	}