? new HashMap()
: new HashMap(initialAttributes);
getAttributeMap(ctx, nodeElement, null, bidiLevel, m);
asb.append(s, m);
int trefEnd = asb.length()-1;
TextPaintInfo tpi;
tpi = (TextPaintInfo)elemTPI.get(nodeElement);
tpi.startChar = trefStart;
tpi.endChar = trefEnd;
initialAttributes = null;
}
}
break;
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
s = n.getNodeValue();
s = normalizeString(s, preserve, prevEndsWithSpace);
if (s.length() != 0) {
asb.append(s, map);
if (preserve) {
endLimit = asb.length();
}
initialAttributes = null;
}
}
}
if (top) {
boolean strippedSome = false;
while ((endLimit < asb.length()) && (asb.getLastChar() == ' ')) {
asb.stripLast();
strippedSome = true;
}
if (strippedSome) {
Iterator iter = elemTPI.values().iterator();
while (iter.hasNext()) {
TextPaintInfo tpi = (TextPaintInfo)iter.next();
if (tpi.endChar >= asb.length()) {
tpi.endChar = asb.length()-1;
if (tpi.startChar > tpi.endChar)
tpi.startChar = tpi.endChar;
}
}
}
}
int elementEndChar = asb.length()-1;
TextPaintInfo tpi = (TextPaintInfo)elemTPI.get(element);
tpi.startChar = elementStartChar;
tpi.endChar = elementEndChar;
}