summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2005-10-31 19:24:25 +0000
committerSteve Northover <steve>2005-10-31 19:24:25 +0000
commitdf5cf3f6d5368a41b2c6ca2836151f5de25984e0 (patch)
tree7163cd8d676e772f69b04bbd5276f5f99016b0bf
parent4e3d6fc0220c054dcd91e2daf263c9a562c7d4cc (diff)
downloadeclipse.platform.swt-df5cf3f6d5368a41b2c6ca2836151f5de25984e0.tar.gz
eclipse.platform.swt-df5cf3f6d5368a41b2c6ca2836151f5de25984e0.tar.xz
eclipse.platform.swt-df5cf3f6d5368a41b2c6ca2836151f5de25984e0.zip
110951 - Combo.setItem(int, String) does not preserve the selection index
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Combo.java4
1 files changed, 4 insertions, 0 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 076b2a37f9..e31e758b47 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
@@ -1309,6 +1309,7 @@ void setForegroundPixel (int pixel) {
public void setItem (int index, String string) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ int selection = OS.SendMessage (handle, OS.CB_GETCURSEL, 0, 0);
remove (index);
/*
* It is possible (but unlikely), that application
@@ -1318,6 +1319,9 @@ public void setItem (int index, String string) {
*/
if (isDisposed ()) return;
add (string, index);
+ if (selection != -1) {
+ OS.SendMessage (handle, OS.CB_SETCURSEL, selection, 0);
+ }
}
/**