From 6801d3a45d355ae79c1e4390eab93179986bfe69 Mon Sep 17 00:00:00 2001 From: Joachim Lingner Date: Thu, 19 Oct 2000 10:17:03 +0000 Subject: *** empty log message *** --- extensions/test/ole/OleTest.htm | 34 ++++++++++++++++++++++++++++++---- extensions/test/ole/cpnt/cpnt.cxx | 20 ++++++++++++++++---- 2 files changed, 46 insertions(+), 8 deletions(-) (limited to 'extensions/test/ole') diff --git a/extensions/test/ole/OleTest.htm b/extensions/test/ole/OleTest.htm index d59392eb9ce9..828ef957ed87 100644 --- a/extensions/test/ole/OleTest.htm +++ b/extensions/test/ole/OleTest.htm @@ -283,6 +283,8 @@ function callOleTest( id) document.writeln( "string: " + arrout1[0] ); break; case (2015): oletest.testout_methodXInterface( arrout1 ); + var outVal= arrout1[0]; + alert( outVal.AttrAny2); document.writeln( "string: " + arrout1[0].AttrAny2); break; case (2016): oletest.testout_methodFloat( arrout1 ); @@ -458,10 +460,30 @@ function callOleTest( id) ret= oletest.AttrAny2; document.writeln( "set: " + obj + " get: " + ret); break; - + + // Structs ---------------------------------------------- case 1020: - var val= 3.14; - oletest.in_float( val); + var struct= oletest._GetStruct("com.sun.star.beans.Property"); + struct.Attributes= 1; + struct.Handle= 2; + struct.Name= "some Property" + oletest.methodStruct( struct); + break; + case 1021: + var struct= oletest.retMethodStruct(); + alert( "Property::Attributes : " + struct.Attributes + " \nProperty::Handle : " + + struct.Handle + "\n Property::Name : " + struct.Name); + break; + case 1022: + var struct= oletest._GetStruct("com.sun.star.beans.Property"); + struct.Attributes= 1; + struct.Handle= 2; + struct.Name= "some Property" + oletest.AttrStruct= struct; + + var struct2= oletest.AttrStruct; + alert( "property get: \n Property::Attributes : " + struct2.Attributes + " \nProperty::Handle : " + + struct2.Handle + "\n Property::Name : " + struct2.Name); break; case 2100: @@ -872,7 +894,11 @@ Test of Any parameter in a property. Any contains:

- +Test of Struct conversions
+ + + + diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index beb7d9b1308c..a3801b421dcb 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.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:16:55 $ + * last change: $Author: jl $ $Date: 2000-10-19 11:17:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -795,6 +795,11 @@ void SAL_CALL OComponent::setAttrAny2(const Any& AttrAny2_) throw( RuntimeExcept void SAL_CALL OComponent::methodStruct(const Property& aProp) throw( RuntimeException ) { + char buff[1024]; + buff[0]= 0; + sprintf( buff,"Property::Attribute : %d \n Property::Handle : %d \n Property::Name : %S", + aProp.Attributes, aProp.Handle, (const sal_Unicode*)aProp.Name); + MessageBox( NULL, A2T(buff), _T("OleTest: methodStruct"), MB_OK); } Property SAL_CALL OComponent::retMethodStruct(void) throw( RuntimeException ) @@ -817,7 +822,13 @@ Property SAL_CALL OComponent::getAttrStruct(void) throw( RuntimeException) } void SAL_CALL OComponent::setAttrStruct(const Property& AttrStruct_) throw( RuntimeException ) -{} +{ + char buff[1024]; + 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); +} // XTestOther ================================================================================== void SAL_CALL OComponent::other_methodAnyIn(const Any& rAny) throw( RuntimeException ) @@ -836,9 +847,10 @@ Any SAL_CALL OComponent::other_methodAnyRet(void) throw(RuntimeException ) } void SAL_CALL OComponent::in_float( float val) throw ( RuntimeException) { + USES_CONVERSION; char buff[256]; sprintf( buff, "parameter : %f", val); - MessageBox( NULL, _T(buff), _T("OleTest"), MB_OK); + MessageBox( NULL, A2T(buff), _T("OleTest"), MB_OK); } // XTestOutParameters ============================================================================ -- cgit v1.2.3