(as.getIterator().first() == ' ');
if (stripLast) {
AttributedString las
= (AttributedString) result.removeLast();
if (las != null) {
AttributedCharacterIterator iter
= las.getIterator();
int endIndex = iter.getEndIndex()-1;
if (iter.setIndex(endIndex) == ' ') {
las = new AttributedString
(las.getIterator (null, iter.getBeginIndex(), endIndex));
}
result.add(las);
}
}
result.add(as);
}
}
break;
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
s = n.getNodeValue();
int[] indexMap = new int[s.length()];
as = createAttributedString
(s, m, indexMap, preserve, stripFirst, last && top);
if (as != null) {
stripLast =
!preserve && (as.getIterator().first() == ' ');
if (stripLast && !result.isEmpty()) {
AttributedString las =
(AttributedString) result.removeLast();
if (las != null) {
AttributedCharacterIterator iter
= las.getIterator();
int endIndex = iter.getEndIndex()-1;
if (iter.setIndex(endIndex) == ' ') {
las = new AttributedString
(las.getIterator(null,
iter.getBeginIndex(), endIndex));
}
result.add(las);
}
}
result.add(as);