int count = Math.max (1, parent.getColumnCount ()); if (0 > index || index > count - 1) return;
public void setFont (int index, Font font) {	checkWidget ();	if (font != null && font.isDisposed ()) {		SWT.error (SWT.ERROR_INVALID_ARGUMENT);	}	int count = Math.max (1, parent.getColumnCount ());	if (0 > index || index > count - 1) return;	int hFont = -1;	if (font != null) {		parent.customDraw = true;		hFont = font.handle;	}	if (cellFont == null) {		cellFont = new int [count];		for (int i = 0; i < count; i++) {			cellFont [i] = -1;		}	}	if (cellFont [index] == hFont) return;	cellFont [index] = hFont;	if ((parent.style & SWT.VIRTUAL) != 0) cached = true;	/*	* Bug in Windows.  When the font is changed for an item,	* the bounds for the item are not updated, causing the text	* to be clipped.  The fix is to reset the text, causing	* Windows to compute the new bounds using the new font.	*/	if (index == 0) {		if ((parent.style & SWT.VIRTUAL) == 0 && !cached && !parent.painted) {			return;		}		if (this != parent.currentItem) {			int hwnd = parent.handle;			TVITEM tvItem = new TVITEM ();			tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_TEXT;			tvItem.hItem = handle;			tvItem.pszText = OS.LPSTR_TEXTCALLBACK;			OS.SendMessage (hwnd, OS.TVM_SETITEM, 0, tvItem);		}	} else {		redraw (index, true, false);	}}