aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2014-04-26 01:30:12 (EDT)
committerNiraj Modi2014-04-26 01:30:12 (EDT)
commitf8d85c84bc214896333b82172f532e8f2bbf581f (patch)
treec298370e73b3ca716234b5056646b64b2002dafc
parent74cf1aa71759b357e771503c2ded76e4ee012f59 (diff)
downloadeclipse.platform.swt-f8d85c84bc214896333b82172f532e8f2bbf581f.zip
eclipse.platform.swt-f8d85c84bc214896333b82172f532e8f2bbf581f.tar.gz
eclipse.platform.swt-f8d85c84bc214896333b82172f532e8f2bbf581f.tar.bz2
Bug 400174 - [Table] Stack overflow with SWT.MeasureItem listenerrefs/changes/41/25541/2
Change-Id: I73fc304df3432061a23994c8226ed009f1e9b244 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java12
1 files changed, 9 insertions, 3 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 f1a27c2..143f501 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -81,7 +81,7 @@ public class Table extends Composite {
long /*int*/ headerToolTipHandle;
boolean ignoreCustomDraw, ignoreDrawForeground, ignoreDrawBackground, ignoreDrawFocus, ignoreDrawSelection, ignoreDrawHot;
boolean customDraw, dragStarted, explorerTheme, firstColumnImage, fixScrollWidth, tipRequested, wasSelected, wasResized, painted;
- boolean ignoreActivate, ignoreSelect, ignoreShrink, ignoreResize, ignoreColumnMove, ignoreColumnResize, fullRowSelect;
+ boolean ignoreActivate, ignoreSelect, ignoreShrink, ignoreResize, ignoreColumnMove, ignoreColumnResize, fullRowSelect, redraw = true;
int itemHeight, lastIndexOf, lastWidth, sortDirection, resizeCount, selectionForeground, hotIndex;
static /*final*/ long /*int*/ HeaderProc;
static final int INSET = 4;
@@ -2864,7 +2864,12 @@ boolean hasChildren () {
boolean hitTestSelection (int index, int x, int y) {
int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
if (count == 0) return false;
- if (!hooks (SWT.MeasureItem)) return false;
+ /*
+ * Return when redraw is false & index is 0, to avoid a possible
+ * recursion, when user sets ItemHeight during SWT.MeasureItem event
+ * processing & with a non-zero table-row selection, refer bug 400174.
+ */
+ if (!hooks (SWT.MeasureItem) || (!redraw && index == 0)) return false;
boolean result = false;
if (0 <= index && index < count) {
TableItem item = _getItem (index);
@@ -4762,6 +4767,7 @@ public void setLinesVisible (boolean show) {
public void setRedraw (boolean redraw) {
checkWidget ();
+ this.redraw = redraw;
/*
* Feature in Windows. When WM_SETREDRAW is used to turn
* off drawing in a widget, it clears the WS_VISIBLE bits