Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Pazderski2019-11-19 14:07:18 +0000
committerPaul Pazderski2020-01-10 23:19:51 +0000
commit218f92e3b9fda0f48cc2d06401f180d5098121e3 (patch)
tree5fc7227ced8059c9293c88253c6aa74600d12c91 /tests
parentbf5c3c1ddc0cfebf86ef561dca4bf89a89745491 (diff)
downloadeclipse.platform.swt-218f92e3b9fda0f48cc2d06401f180d5098121e3.tar.gz
eclipse.platform.swt-218f92e3b9fda0f48cc2d06401f180d5098121e3.tar.xz
eclipse.platform.swt-218f92e3b9fda0f48cc2d06401f180d5098121e3.zip
Bug 343086 - [StyledText] Horizontal scroll bar vanishes when line gets
shorter StyledText did not reclaim free horizontal space on line split. Change-Id: I32840d30ecfa6f430a9b85e3e2a986b1ed50819a Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
index 286617bfa1..72d7232728 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
@@ -5806,6 +5806,7 @@ public void test_clipboardCarryover() {
/**
* Test for:
* Bug 553377 - StyledTextRenderer max width can be invalid
+ * Bug 343086 - Horizontal scroll bar vanishes when line gets shorter
*/
@Test
public void test_claimRightFreeSpace() {
@@ -5832,6 +5833,14 @@ public void test_claimRightFreeSpace() {
text.getHorizontalIndex() < lastScrollIndex && text.getHorizontalIndex() > 0);
n -= cutLenght;
+ // test if widget reclaims horizontal space if longest line is shortened because line get split
+ int newlineOffset = n - 5;
+ text.setCaretOffset(newlineOffset - 2);
+ lastScrollIndex = text.getHorizontalIndex();
+ text.getContent().replaceTextRange(newlineOffset, 0, "\n");
+ assertTrue("Free horizontal space not reclaimed on splitting line",
+ text.getHorizontalIndex() < lastScrollIndex && text.getHorizontalIndex() > 0);
+
// similar to previous test but this time the second half of the split is the new max length line
text.setCaretOffset(0);
text.setHorizontalIndex(100);

Back to the top