if (gc != null) { gc.dispose(); }
} if (gc != null) { gc.dispose();
void setBidiCaretLocation(StyledTextBidi bidi) {	Caret caret = getCaret();		if (caret != null) {		String lineText = content.getLine(caretLine);		int lineStartOffset = content.getOffsetAtLine(caretLine);		int offsetInLine = caretOffset - lineStartOffset;		int caretX;		GC gc = null;				setBidiCaretDirection();				if (bidi == null) {			gc = new GC(this);			bidi = getStyledTextBidi(lineText, lineStartOffset, gc);		}				if (lastCaretDirection == SWT.NULL) {			caretX = bidi.getTextPosition(offsetInLine) + leftMargin;		} else {			caretX = bidi.getTextPosition(offsetInLine, lastCaretDirection) + leftMargin;		}		caretX = caretX - horizontalScrollOffset;		if (StyledTextBidi.getKeyboardLanguageDirection() == SWT.RIGHT) {			caretX -= (getCaretWidth() - 1);		}		caret.setLocation(			caretX, 			caretLine * lineHeight - verticalScrollOffset + topMargin);		if (gc != null) {			gc.dispose();		}	}}