From 8b75883b87c9f7989f98fb413f5e51200c52891c Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 14 Nov 2011 22:07:23 +0100 Subject: Simplified some uses of css.configuration.theDefaultProvider. * Retro-added new-style UNOIDL singleton specification for it, for easy instantiation. * Plus new comphelper::getComponentContext to map from XMultiServiceFactory to XComponentContext. --- odk/examples/java/Inspector/Inspector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'odk') diff --git a/odk/examples/java/Inspector/Inspector.java b/odk/examples/java/Inspector/Inspector.java index c8887d4c0344..39daa05e8826 100644 --- a/odk/examples/java/Inspector/Inspector.java +++ b/odk/examples/java/Inspector/Inspector.java @@ -38,6 +38,7 @@ import com.sun.star.awt.XMessageBoxFactory; import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.NamedValue; import com.sun.star.beans.XPropertySet; +import com.sun.star.configuration.theDefaultProvider; import com.sun.star.container.XNameAccess; import com.sun.star.frame.XModel; import com.sun.star.lang.XComponent; @@ -410,8 +411,7 @@ public class Inspector{ sAccess = "com.sun.star.configuration.ConfigurationAccess"; } XMultiComponentFactory xMCF = m_xComponentContext.getServiceManager(); - Object oDefaultProvider = xMCF.createInstanceWithContext("com.sun.star.configuration.DefaultProvider", this.getXComponentContext()); - XMultiServiceFactory xMSFCfg = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, oDefaultProvider); + XMultiServiceFactory xMSFCfg = theDefaultProvider.get(this.getXComponentContext()); Object oAccess = xMSFCfg.createInstanceWithArguments(sAccess, new Object[]{new NamedValue("nodepath", _sNodePath)}); xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oAccess); } catch (com.sun.star.uno.Exception e) { -- cgit