diff options
Diffstat (limited to 'qadevOOo/runner/helper/OfficeProvider.java')
-rw-r--r-- | qadevOOo/runner/helper/OfficeProvider.java | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/qadevOOo/runner/helper/OfficeProvider.java b/qadevOOo/runner/helper/OfficeProvider.java index adeecbdeba1d..8589de47ea82 100644 --- a/qadevOOo/runner/helper/OfficeProvider.java +++ b/qadevOOo/runner/helper/OfficeProvider.java @@ -130,9 +130,7 @@ public class OfficeProvider implements AppProvider try { - desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, - msf.createInstance( - "com.sun.star.frame.Desktop")); + desk = UnoRuntime.queryInterface(XDesktop.class, msf.createInstance("com.sun.star.frame.Desktop")); } catch (com.sun.star.uno.Exception ue) { @@ -341,18 +339,15 @@ public class OfficeProvider implements AppProvider { // Get component context - final XComponentContext xcomponentcontext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext( - null); + final XComponentContext xcomponentcontext = com.sun.star.comp.helper.Bootstrap.createInitialComponentContext(null); // initial serviceManager final XMultiComponentFactory xLocalServiceManager = xcomponentcontext.getServiceManager(); // create a connector, so that it can contact the office // XUnoUrlResolver urlResolver = UnoUrlResolver.create(xcomponentcontext); - final Object xUrlResolver = xLocalServiceManager.createInstanceWithContext( - "com.sun.star.bridge.UnoUrlResolver", xcomponentcontext); - final XUnoUrlResolver urlResolver = (XUnoUrlResolver) UnoRuntime.queryInterface( - XUnoUrlResolver.class, xUrlResolver); + final Object xUrlResolver = xLocalServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", xcomponentcontext); + final XUnoUrlResolver urlResolver = UnoRuntime.queryInterface(XUnoUrlResolver.class, xUrlResolver); final Object rInitialObject = urlResolver.resolve(connectStr); @@ -363,8 +358,7 @@ public class OfficeProvider implements AppProvider debug = true; dbg("resolved url"); - xMSF = (XMultiServiceFactory) UnoRuntime.queryInterface( - XMultiServiceFactory.class, rInitialObject); + xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, rInitialObject); } return xMSF; @@ -485,7 +479,7 @@ public class OfficeProvider implements AppProvider try { Object quickStarter = msf.createInstance("com.sun.star.office.Quickstart"); - XFastPropertySet fps = (XFastPropertySet) UnoRuntime.queryInterface(XFastPropertySet.class, quickStarter); + XFastPropertySet fps = UnoRuntime.queryInterface(XFastPropertySet.class, quickStarter); fps.setFastPropertyValue(0, false); } catch (com.sun.star.uno.Exception ex) @@ -495,9 +489,7 @@ public class OfficeProvider implements AppProvider try { - desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, - msf.createInstance( - "com.sun.star.frame.Desktop")); + desk = UnoRuntime.queryInterface(XDesktop.class, msf.createInstance("com.sun.star.frame.Desktop")); msf = null; if (desk != null) @@ -616,9 +608,7 @@ public class OfficeProvider implements AppProvider { while (compEnum.hasMoreElements()) { - final XCloseable closer = (XCloseable) UnoRuntime.queryInterface( - XCloseable.class, - compEnum.nextElement()); + final XCloseable closer = UnoRuntime.queryInterface(XCloseable.class, compEnum.nextElement()); if (closer != null) { @@ -658,8 +648,7 @@ public class OfficeProvider implements AppProvider if (xPathSubst != null) { - return (XStringSubstitution) UnoRuntime.queryInterface( - XStringSubstitution.class, xPathSubst); + return UnoRuntime.queryInterface(XStringSubstitution.class, xPathSubst); } else { @@ -790,6 +779,7 @@ public class OfficeProvider implements AppProvider this.ow = ow; } + @Override public void run() { System.out.println(utils.getDateTime() + "OfficeProvider:Owp: start "); |