diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-31 22:06:40 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-31 23:00:10 +0100 |
commit | 9b7542b0928f81b36365b13228a402e8cd64e8cd (patch) | |
tree | b77670bb966219db981b338016206ca23d7b8aa1 /sw/qa/complex/writer | |
parent | 68754260e6f3fdc91a6ab55b4fd99fbd34bf3447 (diff) |
sw: fix insertion of hyperlink inside hyperlink...
... when either the start or the end position of the new hint is equal
to an existing hint. There is not just 1 case here but 3 different
ones; don't attempt to insert hints with start > end.
Change-Id: I39cf8a352f67d77b56b0d01de5872f4d341f6bdd
Diffstat (limited to 'sw/qa/complex/writer')
-rw-r--r-- | sw/qa/complex/writer/TextPortionEnumerationTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java index 4e62d33d3bc0..b793b9ae3747 100644 --- a/sw/qa/complex/writer/TextPortionEnumerationTest.java +++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java @@ -2051,6 +2051,29 @@ public class TextPortionEnumerationTest // this one gets eaten, but we still need to test inserting it (#i106930#) // .appendChild( url6.dup().appendChild( new TextNode("") ) ) .appendChild( new TextNode("89") ); + // inside (left-edge) + TreeNode url7 = new HyperlinkNode( mkName("url") ); + inserter.insertRange( new Range(0, 1, url7) ); + root = new TreeNode() + .appendChild( url7.dup().appendChild( new TextNode("1") ) ) + .appendChild( url2.dup().appendChild( new TextNode("2") ) ) + .appendChild( url1.dup().appendChild( new TextNode("3") ) ) + .appendChild( url4.dup().appendChild( new TextNode("4") ) ) + .appendChild( url5.dup().appendChild( new TextNode("56") ) ) + .appendChild( url4.dup().appendChild( new TextNode("7") ) ) + .appendChild( new TextNode("89") ); + // inside (right-edge) + TreeNode url8 = new HyperlinkNode( mkName("url") ); + inserter.insertRange( new Range(5, 6, url8) ); + root = new TreeNode() + .appendChild( url7.dup().appendChild( new TextNode("1") ) ) + .appendChild( url2.dup().appendChild( new TextNode("2") ) ) + .appendChild( url1.dup().appendChild( new TextNode("3") ) ) + .appendChild( url4.dup().appendChild( new TextNode("4") ) ) + .appendChild( url5.dup().appendChild( new TextNode("5") ) ) + .appendChild( url8.dup().appendChild( new TextNode("6") ) ) + .appendChild( url4.dup().appendChild( new TextNode("7") ) ) + .appendChild( new TextNode("89") ); doTest(root, false); } |