if (isListening(LineGetStyle)) { StyledTextEvent event = getLineEvent(lineOffset, line);  notifyListeners(LineGetStyle, event); if (event.styles != null && wordWrap) { event.styles = getVisualLineStyleData(event.styles, lineOffset, line.length()); } if (event.styles == null) { event.styles = new StyleRange[0]; } else if (isBidi()) { GC gc = new GC(this); if (StyledTextBidi.isLigated(gc)) {        int lineLength = line.length(); StyledTextBidi bidi = new StyledTextBidi(gc, line, new int[] {0, lineLength}); for (int i=0; i<event.styles.length; i++) { StyleRange range = event.styles[i]; StyleRange newRange = null; int relativeStart = range.start - lineOffset; if (relativeStart >= 0) { int startLigature = bidi.getLigatureStartOffset(relativeStart); if (startLigature != relativeStart) { newRange = (StyleRange) range.clone(); range = event.styles[i] = newRange; range.start = range.start - (relativeStart - startLigature); range.length = range.length + (relativeStart - startLigature); } } int rangeEnd = range.start + range.length; int relativeEnd = rangeEnd - lineOffset - 1; if (relativeEnd < lineLength) { int endLigature = bidi.getLigatureEndOffset(relativeEnd); if (endLigature != relativeEnd) { if (newRange == null) { newRange = (StyleRange) range.clone(); range = event.styles[i] = newRange; } range.length = range.length + (endLigature - relativeEnd); } } } } gc.dispose(); } return event; } return null;
return sendLineEvent(LineGetStyle, lineOffset, line);
StyledTextEvent getLineStyleData(int lineOffset, String line) {	if (isListening(LineGetStyle)) {		StyledTextEvent event = getLineEvent(lineOffset, line);		notifyListeners(LineGetStyle, event);		if (event.styles != null && wordWrap) {			event.styles = getVisualLineStyleData(event.styles, lineOffset, line.length());		}		if (event.styles == null) {			event.styles = new StyleRange[0];		}		else		if (isBidi()) {			GC gc = new GC(this);			if (StyledTextBidi.isLigated(gc)) {				// Check for ligatures that are partially styled, if one is found				// automatically apply the style to the entire ligature.				// Since ligatures can't extend over multiple lines (they aren't 				// ligatures if they are separated by a line delimiter) we can ignore				// style starts or ends that are not on the current line.				// Note that there is no need to deal with segments when checking for				// the ligatures.				int lineLength = line.length();				StyledTextBidi bidi = new StyledTextBidi(gc, line, new int[] {0, lineLength});				for (int i=0; i<event.styles.length; i++) {					StyleRange range = event.styles[i];					StyleRange newRange = null;					int relativeStart = range.start - lineOffset;					if (relativeStart >= 0) {						int startLigature = bidi.getLigatureStartOffset(relativeStart);						if (startLigature != relativeStart) {							newRange = (StyleRange) range.clone();							range = event.styles[i] = newRange;							range.start = range.start - (relativeStart - startLigature);							range.length = range.length + (relativeStart - startLigature);						}					}					int rangeEnd = range.start + range.length;					int relativeEnd = rangeEnd - lineOffset - 1;					if (relativeEnd < lineLength) {						int endLigature = bidi.getLigatureEndOffset(relativeEnd);						if (endLigature != relativeEnd) {							if (newRange == null) {								newRange = (StyleRange) range.clone();								range = event.styles[i] = newRange;							}							range.length = range.length + (endLigature - relativeEnd);						}					}		        }		    }		    gc.dispose();		}		return event;	}	return null;}