Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Thienel2016-07-13 15:42:14 -0400
committerFlorian Thienel2016-07-13 15:42:14 -0400
commit347b27fe1021f84f86ef135aec140aeb24c1f5c4 (patch)
tree279f0c84ac41eb0014ed01ab302bbb43766846f5
parenta9d8e35399ce44e844fac17fde487a55a44c93f0 (diff)
downloadorg.eclipse.mylyn.docs.vex-347b27fe1021f84f86ef135aec140aeb24c1f5c4.tar.gz
org.eclipse.mylyn.docs.vex-347b27fe1021f84f86ef135aec140aeb24c1f5c4.tar.xz
org.eclipse.mylyn.docs.vex-347b27fe1021f84f86ef135aec140aeb24c1f5c4.zip
invalidate all affected rows when reconciling cells with vertical span
Signed-off-by: Florian Thienel <florian@thienel.org>
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableCell.java19
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/boxes/TableLayoutGrid.java2
2 files changed, 19 insertions, 2 deletions
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 f7393ffd..938532f8 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 @@ public class TableCell extends BaseBox implements IStructuralBox, IDecoratorBox<
private int verticalSpan = 1;
private GridArea gridArea;
+ private TableLayoutGrid layoutGrid;
private int naturalHeight;
private int usedHeight;
@@ -164,6 +165,14 @@ public class TableCell extends BaseBox implements IStructuralBox, IDecoratorBox<
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 @@ public class TableCell extends BaseBox implements IStructuralBox, IDecoratorBox<
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 f075bb02..cd40f5f2 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 @@ public class TableLayoutGrid {
}
occupy(area, cell);
cell.setGridArea(area);
+ cell.setLayoutGrid(this);
updateNextColumn();
return true;
}
@@ -143,6 +144,7 @@ public class TableLayoutGrid {
final GridArea area = new GridArea(currentRow, nextColumn, currentRow + cell.getVerticalSpan() - 1, nextColumn);
occupy(area, cell);
cell.setGridArea(area);
+ cell.setLayoutGrid(this);
updateNextColumn();
}

Back to the top