summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-08 09:10:29 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-08 09:10:29 +0100
commit382b013275f0dd81d6bbf299782f59d2735c5beb (patch)
tree6fcfccba42ff0ced32342b5c2720dfaf38da19eb /odk
parentb45e8153b28b7447a922129d3e3a182315c8b337 (diff)
Some ConfigurationProvider -> theDefaultProvider simplifications
Change-Id: I7c25cd94f8a1ca339f7423c26f21f13c7a68906d
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/GUI/UnoDialogSample.java5
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/DisableCommands/DisableCommandsTest.java7
-rw-r--r--odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java6
3 files changed, 6 insertions, 12 deletions
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(
diff --git a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
index b38bb8c3b56f..3ae069560838 100644
--- a/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
+++ b/odk/examples/java/EmbedDocument/EmbeddedObject/OwnEmbeddedObject.java
@@ -20,6 +20,7 @@ import java.awt.Dimension;
import java.util.ArrayList;
import com.sun.star.beans.XPropertySet;
+import com.sun.star.configuration.theDefaultProvider;
import com.sun.star.container.XNameAccess;
import com.sun.star.embed.VisualRepresentation;
import com.sun.star.embed.XStorage;
@@ -29,7 +30,6 @@ import com.sun.star.io.XOutputStream;
import com.sun.star.io.XStream;
import com.sun.star.io.XTruncate;
import com.sun.star.lang.XComponent;
-import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lib.uno.helper.WeakBase;
import com.sun.star.uno.AnyConverter;
@@ -987,9 +987,7 @@ public final class OwnEmbeddedObject extends WeakBase
{
try
{
- XMultiComponentFactory xFactory = m_xContext.getServiceManager();
- Object obj = xFactory.createInstanceWithContext( "com.sun.star.configuration.ConfigurationProvider", m_xContext );
- XMultiServiceFactory xConfProvider = UnoRuntime.queryInterface( XMultiServiceFactory.class, obj );
+ XMultiServiceFactory xConfProvider = theDefaultProvider.get(m_xContext);
if ( xConfProvider == null )
throw new com.sun.star.uno.RuntimeException();