summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes <krbarnes>2008-02-04 22:08:12 +0000
committerKevin Barnes <krbarnes>2008-02-04 22:08:12 +0000
commit8526715dfeb863d572bba8bb28b5e6c2225c5cfd (patch)
treee3e5315b5ca347ebab2cf79e3d773c5a506c42e0
parentb6dab3dc248d9135e08e65943e15a6ae36c16846 (diff)
downloadeclipse.platform.swt-8526715dfeb863d572bba8bb28b5e6c2225c5cfd.tar.gz
eclipse.platform.swt-8526715dfeb863d572bba8bb28b5e6c2225c5cfd.tar.xz
eclipse.platform.swt-8526715dfeb863d572bba8bb28b5e6c2225c5cfd.zip
217758 - Combo test failures
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Combo.java16
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java1
2 files changed, 15 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Combo.java
index 0da337745e..17e56c2dec 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Combo.java
@@ -166,6 +166,11 @@ public void add (String string) {
public void add (String string, int index) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
+ if (index < 0) error (SWT.ERROR_INVALID_ARGUMENT);
+ int items = OS.ItemsControl_Items (handle);
+ int count = OS.ItemCollection_Count (items);
+ OS.GCHandle_Free (items);
+ if (index > count) error (SWT.ERROR_INVALID_ARGUMENT);
int itemHandle = OS.gcnew_ComboBoxItem ();
int strPtr = createDotNetString (string, false);
OS.ContentControl_Content (itemHandle, strPtr);
@@ -176,6 +181,9 @@ public void add (String string, int index) {
OS.GCHandle_Free (itemHandle);
}
+void addChild (Control control) {
+}
+
/**
* Adds the listener to the collection of listeners who will
* be notified when the receiver's text is modified, by sending
@@ -449,7 +457,8 @@ public void cut () {
public void deselect (int index) {
checkWidget ();
ignoreSelection = true;
- OS.Selector_SelectedIndex (handle, -1);
+ int selected = OS.Selector_SelectedIndex (handle);
+ if (selected == index) OS.Selector_SelectedIndex (handle, -1);
ignoreSelection = false;
// FIXME: May need to send modify event here.
// if ((style & SWT.READ_ONLY) == 0) {
@@ -900,7 +909,7 @@ public int indexOf (String string, int start) {
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
int count = getItemCount ();
- if (start >= count) return -1;
+ if (start < 0 || start >= count) return -1;
start = Math.max (start, 0);
int strPtr = createDotNetString (string, false);
int itemCollection = OS.ItemsControl_Items (handle);
@@ -1035,6 +1044,9 @@ public void removeAll () {
OS.GCHandle_Free (itemCollection);
}
+void removeChild(Control control) {
+}
+
/**
* Removes the listener from the collection of listeners who will
* be notified when the receiver's text is modified.
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java
index 0ad4852d5d..e3a688bbf4 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/SwtJunit.java
@@ -28,6 +28,7 @@ public class SwtJunit {
public final static boolean isAIX = System.getProperty("os.name").equals("AIX");
public final static boolean isSolaris = System.getProperty("os.name").equals("Solaris") || System.getProperty("os.name").equals("SunOS");
public final static boolean isHPUX = System.getProperty("os.name").equals("HP-UX");
+ public final static boolean isWPF = SWT.getPlatform().startsWith("wpf");
static {
if (isMotif) {