summaryrefslogtreecommitdiff
path: root/extensions/test
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2002-06-20 08:08:28 +0000
committerJoachim Lingner <jl@openoffice.org>2002-06-20 08:08:28 +0000
commit445a4221b98c8ff39c990f3423699b2648a24381 (patch)
tree4e426a130049a735eab6b4b3d7720ddd3fa2d6d0 /extensions/test
parentbf74f2f14ea2e09dd270f4f00b191c37e5850ecc (diff)
*** empty log message ***
Diffstat (limited to 'extensions/test')
-rw-r--r--extensions/test/ole/ScriptTest.html183
-rw-r--r--extensions/test/ole/VisualBasic/Project1.vbw2
-rw-r--r--extensions/test/ole/cpnt/cpnt.cxx14
-rw-r--r--extensions/test/ole/idl/oletest.idl6
4 files changed, 102 insertions, 103 deletions
diff --git a/extensions/test/ole/ScriptTest.html b/extensions/test/ole/ScriptTest.html
index aea3d322a7d1..7445dcdcdf02 100644
--- a/extensions/test/ole/ScriptTest.html
+++ b/extensions/test/ole/ScriptTest.html
@@ -78,6 +78,10 @@ arFunctions["testinout_methodXInterface"]="void testinout_methodXInterface( [ino
arFunctions["testinout_methodXInterface2"]="void testinout_methodXInterface2( [inout] com::sun::star::uno::XInterface rOut)";
arFunctions["methodAnyTest1"]="any methodAnyTest1( [in] any rIn)";
+arFunctions["AttrAny2"]= "[attribute] any AttrAny2";
+arFunctions["retMethodStruct"]= "com::sun::star::beans::Property retMethodStruct()";
+arFunctions["AttrStruct"]= "[attribute] com::sun::star::beans::Property AttrStruct";
+arFunctions["methodStruct2"]= "com::sun::star::beans::Property methodStruct2( [in] com::sun::star::beans::Property aProp)";
var Log= new Logger();
@@ -532,11 +536,93 @@ var sInVal= "this is a string"
ob.value= sInVal;
outVal[0]= ob;
oletest.testinout_methodXInterface( outVal);
-Log.print( outVal[0].value == " this string was written in the UNO component to the inout pararmeter", "testinout_methodXInterface");
+Log.print( outVal[0].value == "out", "testinout_methodXInterface");
+document.writeln("<p>");
+
+i= 100;
+ret= oletest.methodAnyTest1( i);
+Log.print( i == ret, "methodAnyTest1");
+
+i= 3.14;
+ret= oletest.methodAnyTest1( i);
+Log.print( i == ret, "methodAnyTest1");
+
+i= "Hallo"
+ret= oletest.methodAnyTest1( i);
+Log.print( i == ret, "methodAnyTest1");
+
+i= arrInt;
+ret= oletest.methodAnyTest1( i);
+var arr= new VBArray( ret).toArray();
+Log.print( isEqualAr(arr, arrInt), "methodAnyTest1");
+
+var obj= new Object();
+ret= oletest.methodAnyTest1( obj);
+Log.print( obj == ret, "methodAnyTest1");
+
+
+document.writeln("<p>");
+
+
+i= 100;
+oletest.AttrAny2= i;
+ret= oletest.AttrAny2;
+Log.print( i == ret, "AttrAny2");
+
+i= 3.14;
+oletest.AttrAny2= i;
+ret= oletest.AttrAny2;
+Log.print( i == ret, "AttrAny2");
+
+i= "Hallo"
+oletest.AttrAny2= i;
+ret= oletest.AttrAny2;
+Log.print( i == ret, "AttrAny2");
+
+i= arrInt;
+oletest.AttrAny2= i;
+ret= oletest.AttrAny2;
+var arr= new VBArray( ret).toArray();
+Log.print( isEqualAr(arr, arrInt), "AttrAny2");
+
+var obj= new Object();
+oletest.AttrAny2= obj;
+ret= oletest.AttrAny2;
+Log.print( obj == ret, "AttrAny2");
+
document.writeln("<p>");
+// Structs ----------------------------------------------
+
+/* var struct= oletest._GetStruct("com.sun.star.beans.Property"); */
+/* struct.Attributes= 1; */
+/* struct.Handle= 2; */
+/* struct.Name= "some Property" */
+/* oletest.methodStruct( struct); */
+
+var ret= oletest.retMethodStruct();
+Log.print( ret.Attributes == 127 && ret.Handle == 255 && ret.Name == "OleTest_Property", "retMethodStruct");
+
+var astruct= oletest._GetStruct("com.sun.star.beans.Property");
+astruct.Attributes= 1;
+astruct.Handle= 2;
+astruct.Name= "some Property"
+oletest.AttrStruct= astruct;
+
+var ret= oletest.AttrStruct;
+Log.print( ret.Attributes == 127 && ret.Handle == 255 && ret.Name == "OleTest_Property", "AttrStruct");
+ret= oletest.methodStruct2( astruct);
+Log.print( ret === astruct, "methodStruct2");
+
+/* alert("2100"); */
+/* var ret= oletest.retMethodByte(); */
+/* var sfarray= VBArray( ret); */
+/* document.writeln( sfarray.toArray() ); */
+
+
+document.writeln("<p>");
Log.summarize();
@@ -674,71 +760,7 @@ function callOleTest( id)
// Array in-param
-
- // Test ANY
- // Methods
- case 1000:
- i= 100;
- ret= oletest.methodAnyTest1( i);
- document.writeln( "in: " + i + " ret: " + ret);
- break;
- case 1001:
- i= 3.14;
- ret= oletest.methodAnyTest1( i);
- document.writeln( "in: " + i + " ret: " + ret);
- break;
- case 1002:
- i= "Hallo"
- ret= oletest.methodAnyTest1( i);
- document.writeln( "in: " + i + " ret: " + ret);
- break;
- case 1003:
- i= arr;
- ret= oletest.methodAnyTest1( i);
- sfarray= new VBArray( ret);
- document.writeln( "in: " + i + " ret: " + sfarray.toArray());
- break;
- case 1004:
- var obj= new Object();
- obj[1]= "This is index 0";
- ret= oletest.methodAnyTest1( obj);
- document.writeln( "in: " + obj + " ret: " + ret);
- break;
-
- // Test ANY property
- case 1010:
- i= 100;
- oletest.AttrAny2= i;
- ret= oletest.AttrAny2;
- document.writeln( "set: " + i + " get: " + ret);
- break;
- case 1011:
- i= 3.14;
- oletest.AttrAny2= i;
- ret= oletest.AttrAny2;
- document.writeln( "set: " + i + " get: " + ret);
- break;
- case 1012:
- i= "Hallo"
- oletest.AttrAny2= i;
- ret= oletest.AttrAny2;
- document.writeln( "set: " + i + " get: " + ret);
- break;
- case 1013:
- i= arr;
- oletest.AttrAny2= i;
- ret= oletest.AttrAny2;
- sfarray= new VBArray( ret);
- document.writeln( "set: " + i + " get: " + sfarray.toArray());
- break;
- case 1014:
- var obj= new Object();
- obj[1]= "This is index 0";
- oletest.AttrAny2= obj;
- ret= oletest.AttrAny2;
- document.writeln( "set: " + obj + " get: " + ret);
- break;
// Structs ----------------------------------------------
case 1020:
@@ -1113,37 +1135,6 @@ end sub
<p>
-Tests Array/Sequence conversion with Attributes. All params are of type Sequence and
- the element type of the Sequence is written on the buttons. <br>
-<button onclick='callOleTest( 200)'>byte </Button>
-<button onclick='callOleTest( 212)'>float</Button>
-<button onclick='callOleTest( 201)'>double</Button>
-<button onclick='callOleTest( 202)'>boolean</Button>
-<button onclick='callOleTest( 203)'>short</Button>
-<button onclick='callOleTest( 204)'>unsigned short</Button>
-<button onclick='callOleTest( 205)'>long</Button>
-<button onclick='callOleTest( 206)'>unsigned long</Button>
-<button onclick='callOleTest( 207)'>char</Button>
-<button onclick='callOleTest( 208)'>string</Button>
-<button onclick='callOleTest( 209)'>any</Button>
-<button onclick='callOleTest( 210)'>sequence&ltlong&gt </Button>
-<button onclick='callOleTest( 211)'>sequence&ltsequence&ltlong&gt &gt </Button>
-<p>
-
-Test of Any parameter in a method. Any contains:<br>
-<button onclick='callOleTest( 1000)'>integer </Button>
-<button onclick='callOleTest( 1001)'>double </Button>
-<button onclick='callOleTest( 1002)'>string</Button>
-<button onclick='callOleTest( 1003)'>array</Button>
-<button onclick='callOleTest( 1004)'>object</Button>
-<p>
-Test of Any parameter in a property. Any contains:<br>
-<button onclick='callOleTest( 1010)'>integer </Button>
-<button onclick='callOleTest( 1011)'>double </Button>
-<button onclick='callOleTest( 1012)'>string</Button>
-<button onclick='callOleTest( 1013)'>array</Button>
-<button onclick='callOleTest( 1014)'>object</Button>
-<P>
Test of Struct conversions<br>
<button onclick='callOleTest( 1020)'>methodStruct </Button>
<button onclick='callOleTest( 1021)'>return struct</Button>
diff --git a/extensions/test/ole/VisualBasic/Project1.vbw b/extensions/test/ole/VisualBasic/Project1.vbw
index 3d99943cbd3e..ee3bf20e4e2b 100644
--- a/extensions/test/ole/VisualBasic/Project1.vbw
+++ b/extensions/test/ole/VisualBasic/Project1.vbw
@@ -1 +1 @@
-Module1 = 27, 27, 851, 658, Z
+Module1 = 27, 27, 882, 898,
diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx
index 8ecce97584cf..e1e4671b922a 100644
--- a/extensions/test/ole/cpnt/cpnt.cxx
+++ b/extensions/test/ole/cpnt/cpnt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cpnt.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jl $ $Date: 2002-06-05 13:13:48 $
+ * last change: $Author: jl $ $Date: 2002-06-20 09:08:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -221,6 +221,7 @@ public: // XTestSequence
virtual Property SAL_CALL getAttrStruct(void) throw( RuntimeException );
virtual void SAL_CALL setAttrStruct(const Property& AttrStruct_) throw( RuntimeException );
+ virtual Property SAL_CALL methodStruct2( const Property& aProp ) throw (RuntimeException);
// XTestOther
virtual void SAL_CALL other_methodAnyIn(const Any& rAny) throw( RuntimeException );
@@ -896,7 +897,7 @@ void SAL_CALL OComponent::testinout_methodXInterface( Reference< XInvocation >&
any= rOut->getValue( OUString( L"value"));
OUString _s;
any >>= _s;
- OUString string(L" this string was written in the UNO component to the inout pararmeter");
+ OUString string(L"out");
any <<= string;
rOut->setValue( OUString(L"value"), any);
@@ -970,7 +971,12 @@ void SAL_CALL OComponent::setAttrStruct(const Property& AttrStruct_) throw( Runt
buff[0]= 0;
sprintf( buff,"Property::Attribute : %d \n Property::Handle : %d \n Property::Name : %S",
AttrStruct_.Attributes, AttrStruct_.Handle, (const sal_Unicode*)AttrStruct_.Name);
- MessageBox( NULL, A2T(buff), _T("OleTest: setAttrStruct"), MB_OK);
+// MessageBox( NULL, A2T(buff), _T("OleTest: setAttrStruct"), MB_OK);
+}
+
+Property SAL_CALL OComponent::methodStruct2( const Property& aProp ) throw (RuntimeException)
+{
+ return aProp;
}
// XTestOther ==================================================================================
diff --git a/extensions/test/ole/idl/oletest.idl b/extensions/test/ole/idl/oletest.idl
index 812dfa67eb3f..cfeb9e104fed 100644
--- a/extensions/test/ole/idl/oletest.idl
+++ b/extensions/test/ole/idl/oletest.idl
@@ -2,9 +2,9 @@
*
* $RCSfile: oletest.idl,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jl $ $Date: 2002-06-05 13:14:26 $
+ * last change: $Author: jl $ $Date: 2002-06-20 09:08:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -150,6 +150,8 @@ interface XTestStruct: com::sun::star::uno::XInterface
com::sun::star::beans::Property retMethodStruct();
// Attributes as structs
[attribute] com::sun::star::beans::Property AttrStruct;
+
+ com::sun::star::beans::Property methodStruct2( [in] com::sun::star::beans::Property aProp);
};
interface XTestOutParameters: com::sun::star::uno::XInterface