oObj = (XInterface) oInt ;
// create testobject here
log.println( "creating a new environment for Paragraph object" );
TestEnvironment tEnv = new TestEnvironment( oObj );
// adding relation
tEnv.addObjRelation("TargetDocument", comp) ;
final String impStyleName = "XMLStylesImporter" ;
// adding relation for XDocumentHandler
String[][] xml = new String[][] {
{"start", "office:document-styles",
"xmlns:office", "CDATA", "http://openoffice.org/2000/office",
"xmlns:style", "CDATA", "http://openoffice.org/2000/style",
"xmlns:fo", "CDATA", "http://www.w3.org/1999/XSL/Format",
"xmlns:table", "CDATA", "http://openoffice.org/2000/table"},
{"start", "office:styles"},
{"start", "style:style",
"style:name", "CDATA", impStyleName,
"style:family", "CDATA", "table-cell",
"style:parent-style-name", "CDATA", "Default"},
{ "start", "style:properties",
"fo:width", "CDATA", "12cm",
"fo:background-color", "CDATA", "light-grey"},
{"end", "style:properties"},
{"end", "style:style"},
{"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++) {