XModel model = (XModel) UnoRuntime.queryInterface(XModel.class, oDoc);
xFrame = model.getCurrentController().getFrame();
XPropertySet xFramePS = (XPropertySet) UnoRuntime.queryInterface
(XPropertySet.class, xFrame);
XDispatchRecorderSupplier xDRS = null;
xDRS = (XDispatchRecorderSupplier) AnyConverter.toObject(
new Type(XDispatchRecorderSupplier.class),
xFramePS.getPropertyValue("DispatchRecorderSupplier"));
if (xDRS == null) {
Object oDRS = ((XMultiServiceFactory)Param.getMSF()).createInstance(
"com.sun.star.comp.framework.DispatchRecorderSupplier");
xFramePS.setPropertyValue("DispatchRecorderSupplier", oDRS);
xDRS = (XDispatchRecorderSupplier)
UnoRuntime.queryInterface(XDispatchRecorderSupplier.class,oDRS);
}
xDR = xDRS.getDispatchRecorder();
if (xDR != null) {
oObj = xDR;
} else {
oObj = (XInterface)((XMultiServiceFactory)Param.getMSF()).createInstance(
"com.sun.star.comp.framework.DispatchRecorder");
xDR = (XDispatchRecorder) UnoRuntime.queryInterface
(XDispatchRecorder.class, oObj);
xDRS.setDispatchRecorder(xDR);
}
} catch (com.sun.star.uno.Exception e) {
throw new StatusException("Can't create component", e);
}