summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt
diff options
context:
space:
mode:
authorSteve Northover <steve>2002-04-05 16:19:45 +0000
committerSteve Northover <steve>2002-04-05 16:19:45 +0000
commit65bf4c5d778f2bbe2a2c774ea7e619d61748cf21 (patch)
treeb5835a20cdfb36d6a61322d6b63fc3d9bfa12a42 /bundles/org.eclipse.swt
parent88aafbab901ee1991a93ba28e8a2063eda94364d (diff)
downloadeclipse.platform.swt-65bf4c5d778f2bbe2a2c774ea7e619d61748cf21.tar.gz
eclipse.platform.swt-65bf4c5d778f2bbe2a2c774ea7e619d61748cf21.tar.xz
eclipse.platform.swt-65bf4c5d778f2bbe2a2c774ea7e619d61748cf21.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java56
1 files changed, 13 insertions, 43 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java
index 22bcc09ba6..5d56e4c860 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/TableItem.java
@@ -564,12 +564,11 @@ public void setImage (int index, Image image) {
if (image != null && image.isDisposed ()) {
error(SWT.ERROR_INVALID_ARGUMENT);
}
- if (index == 0) {
- setImage (image);
- return;
- }
int itemIndex = parent.indexOf (this);
if (itemIndex == -1) return;
+ if (index == 0) {
+ super.setImage (image);
+ }
int hwnd = parent.handle;
LVITEM lvItem = new LVITEM ();
lvItem.mask = OS.LVIF_IMAGE;
@@ -577,27 +576,14 @@ public void setImage (int index, Image image) {
lvItem.iSubItem = index;
lvItem.iImage = parent.imageIndex (image);
if (OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem) != 0) {
+ if (index == 0) parent.setScrollWidth ();
parent.setCheckboxImageList (false);
}
}
public void setImage (Image image) {
- checkWidget();
- if (image != null && image.isDisposed ()) {
- error(SWT.ERROR_INVALID_ARGUMENT);
- }
- int index = parent.indexOf (this);
- if (index == -1) return;
- super.setImage (image);
- int hwnd = parent.handle;
- LVITEM lvItem = new LVITEM ();
- lvItem.mask = OS.LVIF_IMAGE;
- lvItem.iItem = index;
- lvItem.iImage = parent.imageIndex (image);
- if (OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem) != 0) {
- parent.setScrollWidth ();
- parent.setCheckboxImageList (false);
- }
+ checkWidget ();
+ setImage (0, image);
}
/**
@@ -663,12 +649,11 @@ public void setText (String [] strings) {
public void setText (int index, String string) {
checkWidget();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
- if (index == 0) {
- setText (string);
- return;
- }
int itemIndex = parent.indexOf (this);
if (itemIndex == -1) return;
+ if (index == 0) {
+ super.setText (string);
+ }
int hwnd = parent.handle;
int hHeap = OS.GetProcessHeap ();
TCHAR buffer = new TCHAR (parent.getCodePage (), string, true);
@@ -680,30 +665,15 @@ public void setText (int index, String string) {
lvItem.iItem = itemIndex;
lvItem.pszText = pszText;
lvItem.iSubItem = index;
- OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem);
+ if (OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem) != 0) {
+ if (index == 0) parent.setScrollWidth ();
+ }
OS.HeapFree (hHeap, 0, pszText);
}
public void setText (String string) {
checkWidget();
- if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
- int index = parent.indexOf (this);
- if (index == -1) return;
- super.setText (string);
- int hwnd = parent.handle;
- LVITEM lvItem = new LVITEM ();
- lvItem.mask = OS.LVIF_TEXT;
- lvItem.iItem = index;
- int hHeap = OS.GetProcessHeap ();
- TCHAR buffer = new TCHAR (parent.getCodePage (), string, true);
- int byteCount = buffer.length () * TCHAR.sizeof;
- int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, byteCount);
- OS.MoveMemory (pszText, buffer, byteCount);
- lvItem.pszText = pszText;
- if (OS.SendMessage (hwnd, OS.LVM_SETITEM, 0, lvItem) != 0) {
- parent.setScrollWidth ();
- }
- OS.HeapFree (hHeap, 0, pszText);
+ setText (0, string);
}
}