XMultiServiceFactory xMSF = tParam.getMSF();
SOfficeFactory SOF = null;
SOF = SOfficeFactory.getFactory( xMSF );
String docPath = util.utils.getFullTestURL(doc);
XComponent doc = SOF.loadDocument( docPath );
XModel model = ( XModel ) UnoRuntime.queryInterface( XModel.class,
doc );
oObj =
(XInterface)xMSF.createInstanceWithArguments( "drafts.com.sun.star.script.framework.provider.FunctionProvider", new Object[]{ model } );
provider = ( XFunctionProvider )UnoRuntime.queryInterface( XFunctionProvider.class, oObj );