if (width == 0) { width = DEFAULT_WIDTH; } if (height == 0) { if (singleLine) { height = lineHeight; } else { height = DEFAULT_HEIGHT; } }
if (width == 0)	width = DEFAULT_WIDTH; if (height == 0) height = singleLine ? lineHeight : DEFAULT_HEIGHT;
public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget();	int count, width, height;	boolean singleLine = (getStyle() & SWT.SINGLE) != 0;		if (singleLine) {		count = 1;	} else {		count = content.getLineCount();	}	if (wHint != SWT.DEFAULT) {		width = wHint;	} 	else {		width = DEFAULT_WIDTH;	}	if (wHint == SWT.DEFAULT) {		LineCache computeLineCache = lineCache;		if (wordWrap) {			// set non-wrapping content width calculator. Ensures ideal line width 			// that does not required wrapping. Fixes bug 31195.			computeLineCache = new ContentWidthCache(this, logicalContent);			if (!singleLine) {				count = logicalContent.getLineCount();			}		}		// Only calculate what can actually be displayed.		// Do this because measuring each text line is a 		// time-consuming process.		int visibleCount = Math.min (count, getDisplay().getBounds().height / lineHeight);		computeLineCache.calculate(0, visibleCount);		width = computeLineCache.getWidth() + leftMargin + rightMargin;	}	else	if (wordWrap && !singleLine) {		// calculate to wrap to width hint. Fixes bug 20377. 		// don't wrap live content. Fixes bug 38344.		WrappedContent wrappedContent = new WrappedContent(renderer, logicalContent);		wrappedContent.wrapLines(width);		count = wrappedContent.getLineCount();	}	if (hHint != SWT.DEFAULT) {		height = hHint;	} 	else {		height = count * lineHeight + topMargin + bottomMargin;	}	// Use default values if no text is defined.	if (width == 0) {		width = DEFAULT_WIDTH;	}	if (height == 0) {		if (singleLine) {			height = lineHeight;		}		else {			height = DEFAULT_HEIGHT;		}	}	Rectangle rect = computeTrim(0, 0, width, height);	return new Point (rect.width, rect.height);}