diff options
author | Steve Northover <steve> | 2005-05-06 22:07:05 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2005-05-06 22:07:05 +0000 |
commit | e56f91d844bb979d80488524d970f09348338a23 (patch) | |
tree | a26be138109e4bac462b5d5639a8b31ab432943c | |
parent | 2a99b12f3f121573f6a87579f2b9aa6f85abbe1b (diff) | |
download | eclipse.platform.swt-e56f91d844bb979d80488524d970f09348338a23.tar.gz eclipse.platform.swt-e56f91d844bb979d80488524d970f09348338a23.tar.xz eclipse.platform.swt-e56f91d844bb979d80488524d970f09348338a23.zip |
94003
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java | 11 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java index 0a79c46750..9f63eb6e21 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java @@ -933,15 +933,16 @@ int imageIndex (Image image) { if (hOldList != 0) OS.ImageList_Destroy (hOldList); Rectangle bounds = image.getBounds (); imageList = display.getImageList (new Point (bounds.width, bounds.height)); - int index = imageList.indexOf (image); - if (index == -1) index = imageList.add (image); int hImageList = imageList.getHandle (); OS.SendMessage (hwndCB, OS.TB_SETIMAGELIST, 0, hImageList); - return index; } int index = imageList.indexOf (image); - if (index != -1) return index; - return imageList.add (image); + if (index == -1) { + index = imageList.add (image); + } else { + imageList.put (index, image); + } + return index; } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java index 60c84f1834..43d71069d1 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TabFolder.java @@ -424,15 +424,16 @@ int imageIndex (Image image) { if (imageList == null) { Rectangle bounds = image.getBounds (); imageList = display.getImageList (new Point (bounds.width, bounds.height)); - int index = imageList.indexOf (image); - if (index == -1) index = imageList.add (image); int hImageList = imageList.getHandle (); OS.SendMessage (handle, OS.TCM_SETIMAGELIST, 0, hImageList); - return index; } int index = imageList.indexOf (image); - if (index != -1) return index; - return imageList.add (image); + if (index == -1) { + index = imageList.add (image); + } else { + imageList.put (index, image); + } + return index; } /** |