diff options
author | Steve Northover <steve> | 2007-02-13 15:53:46 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2007-02-13 15:53:46 +0000 |
commit | 5507d45dde1ba5366231358caa9936b0ffbe7deb (patch) | |
tree | 5bb8927d71e265b0e40e6eed82a538984e810561 /bundles | |
parent | 7a7a5788e7468756fae5bc596e2c2c6f75583b57 (diff) | |
download | eclipse.platform.swt-5507d45dde1ba5366231358caa9936b0ffbe7deb.tar.gz eclipse.platform.swt-5507d45dde1ba5366231358caa9936b0ffbe7deb.tar.xz eclipse.platform.swt-5507d45dde1ba5366231358caa9936b0ffbe7deb.zip |
send verify when the same text is set (to be consistent with the Text control)
Diffstat (limited to 'bundles')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java | 7 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java | 6 |
2 files changed, 6 insertions, 7 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 5d36aaac03..46a37f503c 100755 --- 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 @@ -2179,7 +2179,7 @@ LRESULT wmClipboard (int hwndText, int msg, int wParam, int lParam) { if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return null; boolean call = false; int [] start = new int [1], end = new int [1]; - String oldText = null, newText = null; + String newText = null; switch (msg) { case OS.WM_CLEAR: case OS.WM_CUT: @@ -2215,7 +2215,6 @@ LRESULT wmClipboard (int hwndText, int msg, int wParam, int lParam) { break; case OS.WM_SETTEXT: end [0] = OS.GetWindowTextLength (hwndText); - oldText = getText (); int length = OS.IsUnicode ? OS.wcslen (lParam) : OS.strlen (lParam); TCHAR buffer = new TCHAR (getCodePage (), length); int byteCount = buffer.length () * TCHAR.sizeof; @@ -2223,8 +2222,8 @@ LRESULT wmClipboard (int hwndText, int msg, int wParam, int lParam) { newText = buffer.toString (0, length); break; } - if (newText != null && !newText.equals (oldText)) { - oldText = newText; + if (newText != null) { + String oldText = newText; newText = verifyText (newText, start [0], end [0], null); if (newText == null) return LRESULT.ZERO; if (!newText.equals (oldText)) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java index 19f20d9ca6..76952d7417 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Spinner.java @@ -1163,7 +1163,7 @@ LRESULT wmClipboard (int hwndText, int msg, int wParam, int lParam) { // if (!hooks (SWT.Verify) && !filters (SWT.Verify)) return null; boolean call = false; int [] start = new int [1], end = new int [1]; - String oldText = null, newText = null; + String newText = null; switch (msg) { case OS.WM_CLEAR: case OS.WM_CUT: @@ -1198,8 +1198,8 @@ LRESULT wmClipboard (int hwndText, int msg, int wParam, int lParam) { } break; } - if (newText != null && !newText.equals (oldText)) { - oldText = newText; + if (newText != null) { + String oldText = newText; newText = verifyText (newText, start [0], end [0], null); if (newText == null) return LRESULT.ZERO; if (!newText.equals (oldText)) { |