summaryrefslogtreecommitdiff
path: root/javaunohelper/test
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2002-08-08 11:16:07 +0000
committerJoachim Lingner <jl@openoffice.org>2002-08-08 11:16:07 +0000
commitbc392bc875ea6cd048a6d8f4b9e993ff761f2c65 (patch)
treee45533e2d1584bff1b1c91d1f63bb2a8b29107d6 /javaunohelper/test
parentb6c5e6de3d99e70c247676596df74711afcd3ebd (diff)
#99466# returs void Any or Any with Interface type and null reference instead of just null
Diffstat (limited to 'javaunohelper/test')
-rw-r--r--javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java35
1 files changed, 32 insertions, 3 deletions
diff --git a/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java b/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java
index 491e2508e53b..4f1a077879e8 100644
--- a/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java
+++ b/javaunohelper/test/com/sun/star/lib/uno/helper/PropertySet_Test.java
@@ -2,9 +2,9 @@
*
* $RCSfile: PropertySet_Test.java,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jl $ $Date: 2002-04-29 11:28:05 $
+ * last change: $Author: jl $ $Date: 2002-08-08 12:16:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,6 +64,7 @@ package com.sun.star.lib.uno.helper;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.DisposedException;
import com.sun.star.uno.Type;
+import com.sun.star.uno.TypeClass;
import com.sun.star.uno.XInterface;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.Any;
@@ -549,6 +550,10 @@ public class PropertySet_Test
cl.boolClassProp= null;
cl.setPropertyValue("PropBoolClass", null);
r[i++]= cl.boolClassProp == null;
+ // the returned value must be a void any
+ Object objAny= cl.getPropertyValue("PropBoolClass");
+ r[i++]= util.isVoidAny( objAny);
+
cl.boolClassProp= new Boolean(true);
cl.setPropertyValue("PropBoolClass", null);
r[i++]= cl.boolClassProp == null;
@@ -556,6 +561,11 @@ public class PropertySet_Test
cl.setPropertyValue("PropBoolClass", new Any(new Type(boolean.class),null));
r[i++]= cl.boolClassProp == null;
+ cl.propXWeakA.Attributes= PropertyAttribute.MAYBEVOID;
+ cl.setPropertyValue("propXWeakA", null);
+ r[i++]= isVoidAny(cl.getPropertyValue("propXWeakA"));
+ cl.propXWeakA.Attributes= 0;
+
cl.anyPropA= null;
try{
cl.setPropertyValue("PropAnyA", null); i++;
@@ -1633,6 +1643,25 @@ class util
return true;
return false;
}
+
+ // returns true if obj is an any that contains a void or interface type and the
+ // object is null
+ static boolean isVoidAny(Object obj)
+ {
+ boolean ret= false;
+ if( obj != null && obj instanceof Any)
+ {
+ Any a= (Any) obj;
+ if( a.getType().getTypeClass().equals( TypeClass.INTERFACE)
+ && a.getObject() == null) {
+ ret= true;
+ }
+ else if( a.getType().equals( new Type(void.class)) && a.getObject() == null) {
+ ret= true;
+ }
+ }
+ return ret;
+ }
}
class Listener implements XPropertyChangeListener, XVetoableChangeListener,
@@ -1683,4 +1712,4 @@ XPropertiesChangeListener
arEvt= propertyChangeEvent;
}
-} \ No newline at end of file
+}