Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hiesserich2013-10-06 11:48:26 +0000
committerCarsten Hiesserich2013-10-06 12:17:16 +0000
commitcb693c15a25dbdbbc200de676b63c7dc6f15649d (patch)
tree4c343eb29b65dbed40be543376cdf34b3801dc9c
parente88e59e8c685ab615a2933987eaac036e26eb9b2 (diff)
downloadorg.eclipse.mylyn.docs.vex-cb693c15a25dbdbbc200de676b63c7dc6f15649d.tar.gz
org.eclipse.mylyn.docs.vex-cb693c15a25dbdbbc200de676b63c7dc6f15649d.tar.xz
org.eclipse.mylyn.docs.vex-cb693c15a25dbdbbc200de676b63c7dc6f15649d.zip
fix assertion error for comment in table row
Change-Id: Ic0ad967769aeabe6c57acd68d8c64be176dde375 Signed-off-by: Carsten Hiesserich <carsten.hie@gmail.com>
-rw-r--r--org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml85
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/AbstractBlockBox.java2
2 files changed, 86 insertions, 1 deletions
diff --git a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml
index 83842512..e9a25b99 100644
--- a/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml
+++ b/org.eclipse.vex.core.tests/src/org/eclipse/vex/core/internal/layout/tables.xml
@@ -604,4 +604,89 @@
</result>
</test>
+ <test id="Comment at end of table row" layoutWidth="400">
+ <doc><![CDATA[ <root><table><tr><td></td><!--Comment--></tr></table></root> ]]></doc>
+ <result>
+ <box class="RootBox">
+ <box class="BlockElementBox">
+ <box class="BlockElementBox" element="root">
+ <box class="TableBox" element="table">
+ <box class="TableBodyBox">
+ <box class="TableRowGroupBox">
+ <box class="TableRowBox">
+ <box class="TableCellBox">
+ <box class="ParagraphBox">
+ <box class="LineBox">
+ <box class="PlaceholderBox" />
+ </box>
+ </box>
+ </box>
+ <box class="TableCellBox">
+ <box class="NodeBlockBox">
+ <box class="ParagraphBox">
+ <box class="LineBox">
+ <box class="StaticTextBox" />
+ <box class="DocumentTextBox" />
+ <box class="PlaceholderBox" />
+ <box class="StaticTextBox" />
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </result>
+ </test>
+
+ <test id="Comment in table row" layoutWidth="400">
+ <doc><![CDATA[ <root><table><tr><td></td><!--Comment--><td></td></tr></table></root> ]]></doc>
+ <result>
+ <box class="RootBox">
+ <box class="BlockElementBox">
+ <box class="BlockElementBox" element="root">
+ <box class="TableBox" element="table">
+ <box class="TableBodyBox">
+ <box class="TableRowGroupBox">
+ <box class="TableRowBox">
+ <box class="TableCellBox">
+ <box class="ParagraphBox">
+ <box class="LineBox">
+ <box class="PlaceholderBox" />
+ </box>
+ </box>
+ </box>
+ <box class="TableCellBox">
+ <box class="NodeBlockBox">
+ <box class="ParagraphBox">
+ <box class="LineBox">
+ <box class="StaticTextBox" />
+ <box class="DocumentTextBox" />
+ <box class="PlaceholderBox" />
+ <box class="StaticTextBox" />
+ </box>
+ </box>
+ </box>
+ </box>
+ <box class="TableCellBox">
+ <box class="ParagraphBox">
+ <box class="LineBox">
+ <box class="PlaceholderBox" />
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </box>
+ </result>
+ </test>
+
</testcases>
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/AbstractBlockBox.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/AbstractBlockBox.java
index 5ddba71a..597465fb 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/AbstractBlockBox.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/layout/AbstractBlockBox.java
@@ -788,7 +788,7 @@ public abstract class AbstractBlockBox extends AbstractBox implements BlockBox {
public Object next() {
if (!pushStack.isEmpty()) {
return pushStack.removeLast();
- } else if (startOffset == endOffset) {
+ } else if (startOffset >= endOffset) {
return null;
} else {
final INode blockNode = findNextBlockNode(context, parent, startOffset, endOffset);

Back to the top