summaryrefslogtreecommitdiff
path: root/javaunohelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-07 12:03:03 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-02-07 12:03:03 +0100
commitbd20500cf3d88d0bd81d7e57df01b0130e7166f6 (patch)
tree63e6f08b5c17bcab3e3a2c57c6f4063033f3f52c /javaunohelper
parent41324964f5a2200fd5763a51204b20ff0fa1034b (diff)
Simplify access to theCoreReflection singleton
Change-Id: I9901991a320b87895230a92095c9c7d3109380a6
Diffstat (limited to 'javaunohelper')
-rw-r--r--javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java32
1 files changed, 5 insertions, 27 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
index 0f548fe10d93..14f887f82011 100644
--- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
+++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java
@@ -34,20 +34,18 @@ import com.sun.star.lang.DisposedException;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.WrappedTargetException;
import com.sun.star.lang.WrappedTargetRuntimeException;
-import com.sun.star.lang.XComponent;
import com.sun.star.reflection.XCompoundTypeDescription;
import com.sun.star.reflection.XIdlClass;
import com.sun.star.reflection.XIdlField2;
-import com.sun.star.reflection.XIdlReflection;
import com.sun.star.reflection.XIndirectTypeDescription;
import com.sun.star.reflection.XInterfaceAttributeTypeDescription2;
import com.sun.star.reflection.XInterfaceMemberTypeDescription;
import com.sun.star.reflection.XInterfaceTypeDescription2;
import com.sun.star.reflection.XStructTypeDescription;
import com.sun.star.reflection.XTypeDescription;
+import com.sun.star.reflection.theCoreReflection;
import com.sun.star.uno.Any;
import com.sun.star.uno.AnyConverter;
-import com.sun.star.uno.DeploymentException;
import com.sun.star.uno.Type;
import com.sun.star.uno.TypeClass;
import com.sun.star.uno.UnoRuntime;
@@ -79,9 +77,9 @@ public final class PropertySetMixin {
The constructor.
@param context the component context used by this instance; must not be
- null, and must supply the service
- <code>com.sun.star.reflection.CoreReflection</code> and the singleton
- <code>com.sun.star.reflection.theTypeDescriptionManager</code>
+ null, and must supply the
+ <code>com.sun.star.reflection.theCoreReflection</code> and
+ <code>com.sun.star.reflection.theTypeDescriptionManager</code> singletons
@param object the client UNO object into which this instance is mixed in;
must not be null, and must support the given <code>type</code>
@@ -565,27 +563,7 @@ public final class PropertySetMixin {
}
private XIdlClass getReflection(String typeName) {
- XIdlReflection refl;
- try {
- refl = UnoRuntime.queryInterface(
- XIdlReflection.class,
- context.getServiceManager().createInstanceWithContext(
- "com.sun.star.reflection.CoreReflection", context));
- } catch (com.sun.star.uno.Exception e) {
- throw new DeploymentException(
- ("component context fails to supply service"
- + " com.sun.star.reflection.CoreReflection: "
- + e.getMessage()),
- context);
- }
- try {
- return refl.forName(typeName);
- } finally {
- XComponent comp = UnoRuntime.queryInterface(XComponent.class, refl);
- if (comp != null) {
- comp.dispose();
- }
- }
+ return theCoreReflection.get(context).forName(typeName);
}
private void initProperties(