diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-16 14:37:52 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-09-16 14:37:52 +0000 |
commit | c7788533a2565593405e55b617d09425e08ef439 (patch) | |
tree | 3f5e079ea8633edfe8fd37ec9a6fe40a0a4f952f /javaunohelper/com/sun/star/lib | |
parent | 36fc972942594e186e6924bfc1568bfb0096733e (diff) |
CWS-TOOLING: integrate CWS sb113
2009-09-01 sb #i76393# second attempt at properly #ifdef-ing previous HG commit d598efdbf012
2009-08-28 sb #i102469# change back <T extends XInterface> to just <T> on queryInterface, to avoid binary incompatibility (method changing its signature from (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; to (Ljava/lang/Class;Ljava/lang/Object;)Lcom/sun/star/uno/XInterface;)
2009-08-28 sb #i76393# properly #ifdef previous HG commit d598efdbf012
2009-08-27 sb #i94421# work around compiler error (based on a patch supplied by cloph)
2009-08-26 sb merged in DEV300_m56
2009-08-26 sb #i76393# on Linux, include dynamic section offset in crash report so as to be able to map "prelinked" callstacks back to original (patch by cmc)
2009-08-26 sb #i88162# remove unnecessary whitespace lines from per-locale xcu files (patch by tora)
2009-08-17 Juergen Schmidt #i104292# set context classloader after create new custom UNO loader
2009-08-17 Juergen Schmidt #i103749# integrate patch
2009-08-14 sb #i103269# cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r 5124ebd5edd1 ("#i101955# changed encoding of XML file content from erroneous ISO-8859-1 to UTF-8")
2009-08-12 sb #i102469# fixed mis-applications of UnoRuntime.queryInterface (detected via the simplified UnoRuntime.queryInterface, the HG changeset 29de35fc9554) to use AnyConverter instead; changed qadevOOo's lib.MultiMethodTest.before to allow throwing arbitrary exceptions, to cater for IllegalArgumentException thrown by AnyConverter
2009-08-12 sb #i104178# drop extra libxml2-config script from libxmlsec
2009-08-10 sb #i101754# simplified osl_getProcessInfo for LINUX (patch by cmc)
2009-08-10 sb #i95018# avoid closing -1 fds (patch supplied by cmc)
2009-08-10 sb #i103585# removed (apparently unnecessary) zlib support from libxml2; in turn, removed zlib dependencies from libxmlsec, libxslt, and redland (assuming those were transitive dependencies brought in by direct dependencies on libxml2)
2009-08-10 sb #i102469# simplified UnoRuntime.queryInterface using Java 5 generics; adapted URE-related modules accordingly
2009-08-10 sb #i101213# adapted setsolar env (solenv/config/) to set PYTHONPATH (and not set PYTHONHOME) in accordance with configure env (set_soenv.in); fixed testtools/source/bridgetest/pyuno (which now should work everywhere out of the box, thanks to the fixed setsolar PYTHONPATH)
2009-08-10 sb cherry-picked ssh://hg@hg.services.openoffice.org/cws/sb111 -r ea8de6d9396b ("#i101955# work in progress for a .hgignore file, continued")
Diffstat (limited to 'javaunohelper/com/sun/star/lib')
4 files changed, 48 insertions, 52 deletions
diff --git a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java index 6eb261ff0eb8..5842c8eaf7f4 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java @@ -210,7 +210,7 @@ public class Factory throws com.sun.star.uno.Exception { Object inst = instantiate( xContext ); - XInitialization xInit = (XInitialization)UnoRuntime.queryInterface( + XInitialization xInit = UnoRuntime.queryInterface( XInitialization.class, inst ); if (null == xInit) { diff --git a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java index 44a6be5e5f7a..d7bc61cbcbad 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/InterfaceContainer.java @@ -715,7 +715,7 @@ public class InterfaceContainer implements Cloneable try { Object o= aIt.next(); - XEventListener evtListener= (XEventListener) UnoRuntime.queryInterface( + XEventListener evtListener= UnoRuntime.queryInterface( XEventListener.class, o); if( evtListener != null ) evtListener.disposing( evt ); diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java index b4b2d02ab148..d77c1600def3 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java @@ -671,7 +671,7 @@ XMultiPropertySet // We try to get an XInterface of setVal and set an XInterface type. if (setVal instanceof XInterface) { - XInterface xint= (XInterface) UnoRuntime.queryInterface(XInterface.class, setVal); + XInterface xint= UnoRuntime.queryInterface(XInterface.class, setVal); if (xint != null) convObj= new Any(new Type(XInterface.class), xint); } diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java index af33c5ea3ee9..40c69a90f8a6 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java @@ -143,13 +143,13 @@ public final class PropertySetMixin { idlClass = getReflection(type.getTypeName()); XTypeDescription ifc; try { - ifc = (XTypeDescription) UnoRuntime.queryInterface( + ifc = UnoRuntime.queryInterface( XTypeDescription.class, - (((XHierarchicalNameAccess) UnoRuntime.queryInterface( - XHierarchicalNameAccess.class, - context.getValueByName( - "/singletons/com.sun.star.reflection." - + "theTypeDescriptionManager"))). + (UnoRuntime.queryInterface( + XHierarchicalNameAccess.class, + context.getValueByName( + "/singletons/com.sun.star.reflection." + + "theTypeDescriptionManager")). getByHierarchicalName(type.getTypeName()))); } catch (NoSuchElementException e) { throw new RuntimeException( @@ -585,7 +585,7 @@ public final class PropertySetMixin { private XIdlClass getReflection(String typeName) { XIdlReflection refl; try { - refl = (XIdlReflection) UnoRuntime.queryInterface( + refl = UnoRuntime.queryInterface( XIdlReflection.class, context.getServiceManager().createInstanceWithContext( "com.sun.star.reflection.CoreReflection", context)); @@ -599,8 +599,7 @@ public final class PropertySetMixin { try { return refl.forName(typeName); } finally { - XComponent comp = (XComponent) UnoRuntime.queryInterface( - XComponent.class, refl); + XComponent comp = UnoRuntime.queryInterface(XComponent.class, refl); if (comp != null) { comp.dispose(); } @@ -610,9 +609,8 @@ public final class PropertySetMixin { private void initProperties( XTypeDescription type, HashMap map, ArrayList handleNames, HashSet seen) { - XInterfaceTypeDescription2 ifc = (XInterfaceTypeDescription2) - UnoRuntime.queryInterface( - XInterfaceTypeDescription2.class, resolveTypedefs(type)); + XInterfaceTypeDescription2 ifc = UnoRuntime.queryInterface( + XInterfaceTypeDescription2.class, resolveTypedefs(type)); if (seen.add(ifc.getName())) { XTypeDescription[] bases = ifc.getBaseTypes(); for (int i = 0; i < bases.length; ++i) { @@ -622,11 +620,10 @@ public final class PropertySetMixin { for (int i = 0; i < members.length; ++i) { if (members[i].getTypeClass() == TypeClass.INTERFACE_ATTRIBUTE) { - XInterfaceAttributeTypeDescription2 attr - = ((XInterfaceAttributeTypeDescription2) - UnoRuntime.queryInterface( - XInterfaceAttributeTypeDescription2.class, - members[i])); + XInterfaceAttributeTypeDescription2 attr = + UnoRuntime.queryInterface( + XInterfaceAttributeTypeDescription2.class, + members[i]); short attrAttribs = 0; if (attr.isBound()) { attrAttribs |= PropertyAttribute.BOUND; @@ -685,7 +682,7 @@ public final class PropertySetMixin { break; } attrAttribs |= n; - t = ((XStructTypeDescription) UnoRuntime.queryInterface( + t = (UnoRuntime.queryInterface( XStructTypeDescription.class, t)). getTypeArguments()[0]; } @@ -747,14 +744,14 @@ public final class PropertySetMixin { object, illegalArgumentPosition); } - XIdlField2 f = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 f = UnoRuntime.queryInterface( XIdlField2.class, idlClass.getField(name)); Object[] o = new Object[] { new Any(type, UnoRuntime.queryInterface(type, object)) }; Object v = wrapValue( value, - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, idlClass.getField(name))).getType(), + UnoRuntime.queryInterface( + XIdlField2.class, idlClass.getField(name)).getType(), (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0, isAmbiguous, (p.property.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0, @@ -807,7 +804,7 @@ public final class PropertySetMixin { if (p == null) { throw new UnknownPropertyException(name, object); } - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, idlClass.getField(name)); Object value; try { @@ -848,12 +845,12 @@ public final class PropertySetMixin { XIdlClass ambiguous = getReflection(typeName); try { isAmbiguous = AnyConverter.toBoolean( - ((XIdlField2) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIdlField2.class, - ambiguous.getField("IsAmbiguous"))).get(value)); - value = ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, - ambiguous.getField("Value"))).get(value); + ambiguous.getField("IsAmbiguous")).get(value)); + value = UnoRuntime.queryInterface( + XIdlField2.class, + ambiguous.getField("Value")).get(value); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( "unexpected" @@ -867,12 +864,12 @@ public final class PropertySetMixin { XIdlClass defaulted = getReflection(typeName); try { isDefaulted = AnyConverter.toBoolean( - ((XIdlField2) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIdlField2.class, - defaulted.getField("IsDefaulted"))).get(value)); - value = ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, - defaulted.getField("Value"))).get(value); + defaulted.getField("IsDefaulted")).get(value)); + value = UnoRuntime.queryInterface( + XIdlField2.class, + defaulted.getField("Value")).get(value); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( "unexpected" @@ -886,16 +883,16 @@ public final class PropertySetMixin { XIdlClass optional = getReflection(typeName); try { boolean present = AnyConverter.toBoolean( - ((XIdlField2) UnoRuntime.queryInterface( + UnoRuntime.queryInterface( XIdlField2.class, - optional.getField("IsPresent"))).get(value)); + optional.getField("IsPresent")).get(value)); if (!present) { value = Any.VOID; break; } - value = ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, - optional.getField("Value"))).get(value); + value = UnoRuntime.queryInterface( + XIdlField2.class, + optional.getField("Value")).get(value); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( "unexpected" @@ -932,15 +929,15 @@ public final class PropertySetMixin { Object[] strct = new Object[1]; type.createObject(strct); try { - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, type.getField("Value")); field.set( strct, wrapValue( value, field.getType(), false, false, wrapDefaulted, isDefaulted, wrapOptional)); - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, type.getField("IsAmbiguous"))).set( + UnoRuntime.queryInterface( + XIdlField2.class, type.getField("IsAmbiguous")).set( strct, new Boolean(isAmbiguous)); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( @@ -959,15 +956,15 @@ public final class PropertySetMixin { Object[] strct = new Object[1]; type.createObject(strct); try { - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, type.getField("Value")); field.set( strct, wrapValue( value, field.getType(), wrapAmbiguous, isAmbiguous, false, false, wrapOptional)); - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, type.getField("IsDefaulted"))).set( + UnoRuntime.queryInterface( + XIdlField2.class, type.getField("IsDefaulted")).set( strct, new Boolean(isDefaulted)); } catch (com.sun.star.lang.IllegalArgumentException e) { throw new RuntimeException( @@ -986,11 +983,11 @@ public final class PropertySetMixin { type.createObject(strct); boolean present = !AnyConverter.isVoid(value); try { - ((XIdlField2) UnoRuntime.queryInterface( - XIdlField2.class, type.getField("IsPresent"))).set( + UnoRuntime.queryInterface( + XIdlField2.class, type.getField("IsPresent")).set( strct, new Boolean(present)); if (present) { - XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface( + XIdlField2 field = UnoRuntime.queryInterface( XIdlField2.class, type.getField("Value")); field.set( strct, @@ -1018,9 +1015,8 @@ public final class PropertySetMixin { private static XTypeDescription resolveTypedefs(XTypeDescription type) { while (type.getTypeClass() == TypeClass.TYPEDEF) { - type = ((XIndirectTypeDescription) UnoRuntime.queryInterface( - XIndirectTypeDescription.class, type)). - getReferencedType(); + type = UnoRuntime.queryInterface( + XIndirectTypeDescription.class, type).getReferencedType(); } return type; } |