if (start < itemLimit) { item.analysis.fLinkAfter = true; linkBefore = true;
if (start < itemLimit && 0 < start && start < end) { char pChar = segmentsText.charAt(start - 1); char tChar = segmentsText.charAt(start); if (!Compatibility.isWhitespace(pChar) && !Compatibility.isWhitespace(tChar)) { item.analysis.fLinkAfter = true; linkBefore = true; }
StyleItem[] merge (int items, int itemCount) {	int count = 0, start = 0, end = segmentsText.length(), itemIndex = 0, styleIndex = 0;	StyleItem[] runs = new StyleItem[itemCount + styles.length];	SCRIPT_ITEM scriptItem = new SCRIPT_ITEM();	boolean linkBefore = false;	while (start < end) {		StyleItem item = new StyleItem();		item.start = start;		item.style = styles[styleIndex].style;		runs[count++] = item;		OS.MoveMemory(scriptItem, items + itemIndex * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof);		item.analysis = scriptItem.a;		if (linkBefore) {			item.analysis.fLinkBefore = true;			linkBefore = false;		}		scriptItem.a = new SCRIPT_ANALYSIS();		OS.MoveMemory(scriptItem, items + (itemIndex + 1) * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof);		int itemLimit = scriptItem.iCharPos;		int styleLimit = translateOffset(styles[styleIndex + 1].start);		if (styleLimit <= itemLimit) {			styleIndex++;			start = styleLimit;			if (start < itemLimit) {				item.analysis.fLinkAfter = true;				linkBefore = true;			}		}		if (itemLimit <= styleLimit) {			itemIndex++;			start = itemLimit;		}		item.length = start - item.start;	}	StyleItem item = new StyleItem();	item.start = end;	OS.MoveMemory(scriptItem, items + itemCount * SCRIPT_ITEM.sizeof, SCRIPT_ITEM.sizeof);	item.analysis = scriptItem.a;	runs[count++] = item;	if (runs.length != count) {		StyleItem[] result = new StyleItem[count];		System.arraycopy(runs, 0, result, 0, count);		return result;	}	return runs;}