{"end", "office:styles"},
{"end", "office:document-styles"}} ;
tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;
XNameAccess styles = null ;
try {
XStyleFamiliesSupplier sup = (XStyleFamiliesSupplier)
UnoRuntime.queryInterface
(XStyleFamiliesSupplier.class, xSheetDoc);
XNameAccess oStyleFamilies = sup.getStyleFamilies();
Object family = oStyleFamilies.getByName("CellStyles") ;
styles = (XNameAccess) UnoRuntime.queryInterface
(XNameAccess.class, family) ;
log.println("Styles before:") ;
String[] names = styles.getElementNames() ;
for (int i = 0; i < names.length; i++) {
log.println(" " + names[i]) ;
}
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log) ;
}
final XNameAccess stylesF = styles ;
final PrintWriter logF = log ;
tEnv.addObjRelation("XDocumentHandler.ImportChecker",
new ifc.xml.sax._XDocumentHandler.ImportChecker() {
public boolean checkImport() {
logF.println("Styles after:") ;
String[] names = stylesF.getElementNames() ;
for (int i = 0; i < names.length; i++) {
logF.println(" " + names[i]) ;
}
return stylesF.hasByName(impStyleName) ;
}
}) ;
return tEnv ;
}