} catch (com.sun.star.uno.Exception e) {
e.printStackTrace( log );
throw new StatusException("Couldn't create document", e);
}
XModel aModel = (XModel)
UnoRuntime.queryInterface(XModel.class, xImpressDoc);
XInterface oObj = aModel.getCurrentController();
//Change to Slide view
try {
String aSlotID = "slot:27011";
XDispatchProvider xDispProv = (XDispatchProvider)
UnoRuntime.queryInterface( XDispatchProvider.class, oObj );
XURLTransformer xParser = (com.sun.star.util.XURLTransformer)
UnoRuntime.queryInterface(XURLTransformer.class,
((XMultiServiceFactory)Param.getMSF()).createInstance("com.sun.star.util.URLTransformer"));
// Because it's an in/out parameter we must use an array of URL objects.
URL[] aParseURL = new URL[1];
aParseURL[0] = new URL();
aParseURL[0].Complete = aSlotID;
xParser.parseStrict(aParseURL);
URL aURL = aParseURL[0];
XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0);
if( xDispatcher != null )
xDispatcher.dispatch( aURL, null );
} catch (com.sun.star.uno.Exception e) {
log.println("Couldn't change to slide view");
}
try {
log.println( "creating a second impress document" );
xSecondDrawDoc = SOF.createImpressDoc(null);
shortWait();
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace( log );
throw new StatusException("Couldn't create document", e);
}
XModel aModel2 = (XModel)
UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc);
XWindow anotherWindow = (XWindow) UnoRuntime.queryInterface(
XWindow.class,aModel2.getCurrentController());
oObj = aModel.getCurrentController();
log.println( "creating a new environment for slide view object" );
TestEnvironment tEnv = new TestEnvironment( oObj );
if (anotherWindow != null) {
tEnv.addObjRelation("XWindow.AnotherWindow", anotherWindow);
}
//Adding ObjRelations for XController
tEnv.addObjRelation("FirstModel", aModel);
XFrame the_frame = the_Desk.getCurrentFrame();
tEnv.addObjRelation("Frame", the_frame);
//Adding ObjRelations for XController
tEnv.addObjRelation("SecondModel", aModel2);
XController secondController = aModel2.getCurrentController();
tEnv.addObjRelation("SecondController", secondController);
tEnv.addObjRelation("XDispatchProvider.URL",
"slot:27069");
tEnv.addObjRelation("XUserInputInterception.XModel", aModel);