diff options
author | Arne Deutsch | 2017-08-04 12:29:34 +0000 |
---|---|---|
committer | Leo Ufimtsev | 2017-08-18 15:06:04 +0000 |
commit | 4610363d0b2ed6494338d486beb57127e6009d22 (patch) | |
tree | e6eede0fd0db40cfead97f9c91edba6410cf0662 /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom | |
parent | f28f8cb0510c91905751bee0f128e0912d8324c8 (diff) | |
download | eclipse.platform.swt-4610363d0b2ed6494338d486beb57127e6009d22.tar.gz eclipse.platform.swt-4610363d0b2ed6494338d486beb57127e6009d22.tar.xz eclipse.platform.swt-4610363d0b2ed6494338d486beb57127e6009d22.zip |
[Bug 500475] Guard 'doubleClickSelection' with 'doubleClickEnabled'.
The field 'doubleClickSelection' might be accessed only in case
'doubleClickEnabled' is true. Otherwise it will be null and NPE is the
result. In case 'doubleClickEnabled = false" 'selectionAnchor' will
already have the correct value.
Added snippet to reproduce bug.
Change-Id: Id5743435fd231dc03df8376122495a51b9bcb662
Signed-off-by: Arne Deutsch <arne@idedeluxe.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index 413fca4417..9467d62478 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -9466,7 +9466,7 @@ public void setMargins (int leftMargin, int topMargin, int rightMargin, int bott * Flips selection anchor based on word selection direction. */ void setMouseWordSelectionAnchor() { - if (clickCount > 1) { + if (doubleClickEnabled && clickCount > 1) { if (caretOffset < doubleClickSelection.x) { selectionAnchor = doubleClickSelection.y; } else if (caretOffset > doubleClickSelection.y) { |