From 382b013275f0dd81d6bbf299782f59d2735c5beb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 8 Jan 2014 09:10:29 +0100 Subject: Some ConfigurationProvider -> theDefaultProvider simplifications Change-Id: I7c25cd94f8a1ca339f7423c26f21f13c7a68906d --- odk/examples/DevelopersGuide/GUI/UnoDialogSample.java | 5 ++--- .../OfficeDev/DisableCommands/DisableCommandsTest.java | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'odk/examples/DevelopersGuide') diff --git a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java index e69799580746..851158f91d81 100644 --- a/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java +++ b/odk/examples/DevelopersGuide/GUI/UnoDialogSample.java @@ -76,6 +76,7 @@ import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XMultiPropertySet; import com.sun.star.beans.XPropertySet; +import com.sun.star.configuration.theDefaultProvider; import com.sun.star.container.XIndexContainer; import com.sun.star.container.XNameAccess; import com.sun.star.container.XNameContainer; @@ -193,13 +194,11 @@ public class UnoDialogSample implements XTextListener, XSpinListener, XActionLis */ public XNameAccess getRegistryKeyContent(String _sKeyName){ try { - Object oConfigProvider; PropertyValue[] aNodePath = new PropertyValue[1]; - oConfigProvider = m_xMCF.createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider", this.m_xContext); + XMultiServiceFactory xMSFConfig = theDefaultProvider.get(m_xContext); aNodePath[0] = new PropertyValue(); aNodePath[0].Name = "nodepath"; aNodePath[0].Value = _sKeyName; - XMultiServiceFactory xMSFConfig = UnoRuntime.queryInterface(XMultiServiceFactory.class, oConfigProvider); Object oNode = xMSFConfig.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aNodePath); XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, oNode); return xNameAccess; diff --git a/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java b/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java index f81c59afca31..2f161b42708e 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java +++ b/odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java @@ -32,6 +32,7 @@ * *************************************************************************/ +import com.sun.star.configuration.theDefaultProvider; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.lang.XMultiComponentFactory; @@ -79,11 +80,7 @@ public class DisableCommandsTest extends java.lang.Object { xTransformer = UnoRuntime.queryInterface(com.sun.star.util.XURLTransformer.class, transformer ); - Object configProvider = xRemoteServiceManager.createInstanceWithContext( - "com.sun.star.configuration.ConfigurationProvider", - xRemoteContext ); - xConfigProvider = UnoRuntime.queryInterface( - com.sun.star.lang.XMultiServiceFactory.class, configProvider ); + xConfigProvider = theDefaultProvider.get(xRemoteContext); // create a new test document Object oDesktop = xRemoteServiceManager.createInstanceWithContext( -- cgit