int cstart = rangeStart-start;
int climit = rangeLimit-start;
if (newText == null) {
newText = new StyledText(oldText, start, limit);
}
StyleModifier mod = (StyleModifier) fModifierCache.get(style);
newText.modifyCharacterStyles(cstart, climit, mod);
}
}
if (newText != null) {
int oldStart = panel.getSelectionStart();
int oldLimit = panel.getSelectionEnd();
panel.replaceRange(newText, start, limit);
panel.select(oldStart, oldLimit);
if (oldStart == oldLimit) {
StyleModifier mod = (StyleModifier) fModifierCache.get(AttributeMap.EMPTY_ATTRIBUTE_MAP);
panel.modifyCharacterStyleOnSelection(mod);
}
}
}