if (s.length() > 0) {
try {
pswDoc.addParagraphData(s, tStyle);
}
catch (Exception e) {
throw new ConvertException(
"Error adding data to paragraph in " +
"PocketWordDocument.\n" + e.toString());
}
}
break;
case Node.ELEMENT_NODE:
if (child.getNodeName().equals(TAG_SPACE)) {
StringBuffer sb = new StringBuffer("");
int count = 1;
NamedNodeMap map = child.getAttributes();
if (map.getLength() > 0) {
Node attr = map.getNamedItem(ATTRIBUTE_SPACE_COUNT);
count = Integer.parseInt(attr.getNodeValue().trim());
}
for ( ; count > 0; count--) {
sb.append(" ");
}
/*
* May want to look at style info for spaces. Could
* be important when calculating font metrics.
*/
try {
pswDoc.addParagraphData(sb.toString(), tStyle);
}
catch (Exception e) {
throw new ConvertException(
"Error adding data to paragraph in " +
"PocketWordDocument.\n" + e.toString());
}
}
else if (child.getNodeName().equals(TAG_TAB_STOP)) {
try {
pswDoc.addParagraphData("\t", tStyle);
}
catch (Exception e) {
throw new ConvertException(
"Error adding data to paragraph in " +
"PocketWordDocument.\n" + e.toString());
}
}