Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine2005-02-08 12:48:37 +0000
committerVeronika Irvine2005-02-08 12:48:37 +0000
commit821be3fc4ca373575ad7aaa1ca93073d9af95dc8 (patch)
tree411d13503792a0d8cfc7979d23dab920735bb53a
parent54fee0972d0543cb3c025f25166b6d104d63fb11 (diff)
downloadeclipse.platform.swt-eclipse_3_1_v3122.tar.gz
eclipse.platform.swt-eclipse_3_1_v3122.tar.xz
eclipse.platform.swt-eclipse_3_1_v3122.zip
Bug84609 - ArrayIndexOutOfBounds in LVN_GETDISPINFO due to temporary columneclipse_3_1_v3122
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java24
1 files changed, 10 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index 806ad3bdb4..4cb8af22ba 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -3397,20 +3397,16 @@ LRESULT wmNotifyChild (int wParam, int lParam) {
// if (drawCount != 0 || !OS.IsWindowVisible (handle)) break;
NMLVDISPINFO plvfi = new NMLVDISPINFO ();
OS.MoveMemory (plvfi, lParam, NMLVDISPINFO.sizeof);
- if (ignoreResize) {
- /*
- * Feature in Windows. When LVSCW_AUTOSIZE_USEHEADER is used
- * with LVM_SETCOLUMNWIDTH to resize the last column, the last
- * column is expanded to fill the client area. The fix is to
- * insert and remove a temporary last column for the duration
- * of LVM_SETCOLUMNWIDTH. As a result, LVN_GETDISPINFO should
- * be ignored for the temporary column.
- */
- int hwndHeader = OS.SendMessage (handle, OS.LVM_GETHEADER, 0, 0);
- int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);
- if (count == 1 && columns [0] == null) count = 0;
- if (count - 1 >= plvfi.iSubItem) break;
- }
+ /*
+ * Feature in Windows. When LVSCW_AUTOSIZE_USEHEADER is used
+ * with LVM_SETCOLUMNWIDTH to resize the last column, the last
+ * column is expanded to fill the client area. The fix is to
+ * insert and remove a temporary last column for the duration
+ * of LVM_SETCOLUMNWIDTH. As a result, LVN_GETDISPINFO should
+ * be ignored for the temporary column.
+ */
+ if (ignoreResize && (plvfi.iSubItem >= columns.length || columns [plvfi.iSubItem] == null)) break;
+
lastIndexOf = plvfi.iItem;
TableItem item = _getItem (plvfi.iItem);
/*

Back to the top