if (autoStylesNode == null) {
autoStylesNode = doc.createElement(TAG_OFFICE_AUTOMATIC_STYLES);
doc.insertBefore(autoStylesNode, bodyNode);
}
CellStyle tStyle = new
CellStyle( "Default",SxcConstants.TABLE_CELL_STYLE_FAMILY,
SxcConstants.DEFAULT_STYLE, fmt, null);
String styleName;
Style result[] = (Style[]) styleCat.getMatching(tStyle);
if(result.length==0) {
tStyle.setName("ce" + textStyles++);
styleName = tStyle.getName();
Debug.log(Debug.TRACE,"No existing style found, adding " + styleName);
styleCat.add(tStyle);
} else {
CellStyle existingStyle = (CellStyle) result[0];
styleName = existingStyle.getName();
Debug.log(Debug.TRACE,"Existing style found : " + styleName);
}
cellElement.setAttribute(ATTRIBUTE_TABLE_STYLE_NAME, styleName);