You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix replaceTextRange logic for unfocused StyledText with variable line
height
- Updated productive code to prevent IllegalArgumentException when
replacing text in a StyledText control with variable line height and no
focus, by adding boundary checks.
- Added a regression test to validate the fix: ensures no exception is
thrown when replacing the full text range under these conditions.
Fixes: #2302
Copy file name to clipboardExpand all lines: tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -70,13 +70,15 @@
70
70
importorg.eclipse.swt.graphics.RGB;
71
71
importorg.eclipse.swt.graphics.Rectangle;
72
72
importorg.eclipse.swt.internal.BidiUtil;
73
+
importorg.eclipse.swt.layout.FillLayout;
73
74
importorg.eclipse.swt.layout.GridData;
74
75
importorg.eclipse.swt.layout.GridLayout;
75
76
importorg.eclipse.swt.printing.Printer;
76
77
importorg.eclipse.swt.widgets.Caret;
77
78
importorg.eclipse.swt.widgets.Display;
78
79
importorg.eclipse.swt.widgets.Event;
79
80
importorg.eclipse.swt.widgets.ScrollBar;
81
+
importorg.eclipse.swt.widgets.Text;
80
82
importorg.eclipse.swt.widgets.Widget;
81
83
importorg.junit.Assume;
82
84
importorg.junit.Before;
@@ -195,6 +197,35 @@ public void test_getTextBounds() {
0 commit comments