diff options
author | Niraj Modi | 2016-07-11 10:24:39 +0000 |
---|---|---|
committer | Niraj Modi | 2016-07-11 10:24:39 +0000 |
commit | 11b1b277266859775b4b4ea02e9f9f2018ee08a8 (patch) | |
tree | c6990615b38f4b49f6f8d70351f12a060dba93a6 /bundles/org.eclipse.swt | |
parent | 41da72d487125181543ae97b5a0879c5799fb4c1 (diff) | |
download | eclipse.platform.swt-11b1b277266859775b4b4ea02e9f9f2018ee08a8.tar.gz eclipse.platform.swt-11b1b277266859775b4b4ea02e9f9f2018ee08a8.tar.xz eclipse.platform.swt-11b1b277266859775b4b4ea02e9f9f2018ee08a8.zip |
Bug 496939 - [win32] ctrl+backspace in preferences dialog crashed
platform
Change-Id: Iadab6b5eccd36b54922ee97c920dba10780a4ca0
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java | 9 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java index 19b311f332..a196c4f937 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -3078,7 +3078,12 @@ LRESULT wmChar (long /*int*/ hwnd, long /*int*/ wParam, long /*int*/ lParam) { */ case SWT.DEL: if (OS.GetKeyState (OS.VK_CONTROL) < 0) { - if ((style & SWT.READ_ONLY) != 0) return LRESULT.ZERO; + /* + * 'Ctrl + BackSpace' functionality uses 'EM_REPLACESEL' native + * API which is supported from Windows Vista. Adding OS version + * check to avoid crash on WinXP, see more details on bug 496939 + */ + if (OS.WIN32_VERSION < OS.VERSION (6, 0) || (style & SWT.READ_ONLY) != 0) return LRESULT.ZERO; Point selection = getSelection (); long /*int*/ hwndText = OS.GetDlgItem (handle, CBID_EDIT); int x = selection.x; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java index 9f9eb48e68..7e1b915c9a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -2732,7 +2732,12 @@ LRESULT WM_CHAR (long /*int*/ wParam, long /*int*/ lParam) { switch ((int)/*64*/wParam) { case SWT.DEL: if (OS.GetKeyState (OS.VK_CONTROL) < 0) { - if ((style & SWT.READ_ONLY) != 0 || (style & SWT.PASSWORD) != 0) return LRESULT.ZERO; + /* + * 'Ctrl + BackSpace' functionality uses 'EM_REPLACESEL' native + * API which is supported from Windows Vista. Adding OS version + * check to avoid crash on WinXP, see more details on bug 496939 + */ + if (OS.WIN32_VERSION < OS.VERSION (6, 0) || (style & SWT.READ_ONLY) != 0 || (style & SWT.PASSWORD) != 0) return LRESULT.ZERO; Point selection = getSelection (); int x = selection.x; int y = selection.y; |