diff options
-rw-r--r-- | extensions/test/ole/VisualBasic/Module1.bas | 103 | ||||
-rw-r--r-- | extensions/test/ole/cpnt/cpnt.cxx | 34 | ||||
-rw-r--r-- | extensions/test/ole/idl/oletest.idl | 7 |
3 files changed, 138 insertions, 6 deletions
diff --git a/extensions/test/ole/VisualBasic/Module1.bas b/extensions/test/ole/VisualBasic/Module1.bas index 80f1892e1..e3ab7b34e 100644 --- a/extensions/test/ole/VisualBasic/Module1.bas +++ b/extensions/test/ole/VisualBasic/Module1.bas @@ -459,6 +459,50 @@ For countvar = 0 To 2 End If Next +'Array containing interfaces (element type is VT_DISPATCH) +Dim arEventListener(2) As Object +For countvar = 0 To 2 + Set arEventListener(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arEventListener(countvar).setQuiet True +Next + +'The function calls disposing on the listeners +seq = objOleTest.methodXEventListeners(arEventListener) +Dim count +For countvar = 0 To 2 + If arEventListener(countvar).disposingCalled = False Then + MsgBox "Error" + End If +Next +'Array containing interfaces (element type is VT_VARIANT which contains VT_DISPATCH +Dim arEventListener2(2) As Variant +For countvar = 0 To 2 + Set arEventListener2(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arEventListener2(countvar).setQuiet True +Next +seq = objOleTest.methodXEventListeners(arEventListener2) +For countvar = 0 To 2 + If arEventListener2(countvar).disposingCalled = False Then + MsgBox "Error" + End If +Next + +'Variant containing Array containing interfaces (element type is VT_VARIANT which contains VT_DISPATCH +Dim arEventListener3(2) As Variant +For countvar = 0 To 2 + Dim var As Variant + Set arEventListener3(countvar) = CreateObject("VBasicEventListener.VBEventListener") + arEventListener3(countvar).setQuiet True +Next +Dim varContAr As Variant +varContAr = arEventListener3 +seq = objOleTest.methodXEventListeners(varContAr) +For countvar = 0 To 2 + If arEventListener3(countvar).disposingCalled = False Then + MsgBox "Error" + End If +Next + 'Get a sequence created in UNO, out param is Variant ( VT_BYREF|VT_VARIANT) Dim seqX As Variant @@ -562,6 +606,63 @@ For countDim2 = 0 To 1 Next countDim1 Next countDim2 +'Array containing interfaces (element type is VT_DISPATCH) +Dim arArEventListener(1, 2) As Object +For i = 0 To 1 + For j = 0 To 2 + Set arArEventListener(i, j) = CreateObject("VBasicEventListener.VBEventListener") + arArEventListener(i, j).setQuiet True + Next +Next +'The function calls disposing on the listeners +seq = objOleTest.methodXEventListenersMul(arArEventListener) +For i = 0 To 1 + For j = 0 To 2 + If arArEventListener(i, j).disposingCalled = False Then + MsgBox "Error" + End If + Next +Next + +'Array containing interfaces (element type is VT_VARIANT containing VT_DISPATCH) +Dim arArEventListener2(1, 2) As Variant +For i = 0 To 1 + For j = 0 To 2 + Set arArEventListener2(i, j) = CreateObject("VBasicEventListener.VBEventListener") + arArEventListener2(i, j).setQuiet True + Next +Next +'The function calls disposing on the listeners +seq = objOleTest.methodXEventListenersMul(arArEventListener2) +For i = 0 To 1 + For j = 0 To 2 + If arArEventListener2(i, j).disposingCalled = False Then + MsgBox "Error" + End If + Next +Next + +' SAFEARRAY of VARIANTS containing SAFEARRAYs +'The ultimate element type is VT_DISPATCH ( XEventListener) +Dim arEventListener4(1) As Variant +Dim seq1(2) As Object +Dim seq2(2) As Object +For i = 0 To 2 + Set seq1(i) = CreateObject("VBasicEventListener.VBEventListener") + Set seq2(i) = CreateObject("VBasicEventListener.VBEventListener") + seq1(i).setQuiet True + seq2(i).setQuiet True +Next +arEventListener4(0) = seq1 +arEventListener4(1) = seq2 +'The function calls disposing on the listeners +seq = objOleTest.methodXEventListenersMul(arEventListener4) +For i = 0 To 2 + If seq1(i).disposingCalled = False Or seq2(i).disposingCalled = False Then + MsgBox "Error" + End If +Next + 'Bridge_GetStruct '======================================================== 'Try to create a hidden document @@ -620,7 +721,7 @@ For Each key In ret Next key -objVal.InitInOutParam "[]byte", 10 +objVal.InitInOutParam "byte", 10 objOleTest.testinout_methodByte objVal ret = 0 diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index e0abf46c7..2246fe552 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.5 $ + * $Revision: 1.6 $ * - * last change: $Author: jl $ $Date: 2001-12-03 13:56:48 $ + * last change: $Author: jl $ $Date: 2002-06-05 13:13:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -143,7 +143,9 @@ public: // XTestSequence virtual Sequence< Reference< XInterface > > SAL_CALL methodXInterface( const Sequence< Reference< XInterface > >& aSeq ) throw(RuntimeException) ; virtual Sequence< Sequence< sal_Int32 > > SAL_CALL methodSequence(const Sequence< Sequence< sal_Int32 > >& aSeq) throw( RuntimeException ); virtual Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL methodSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq) throw( RuntimeException ); - + virtual Sequence< Reference<XEventListener> > SAL_CALL methodXEventListeners( const Sequence<Reference<XEventListener> >& aSeq) throw( RuntimeException); + virtual Sequence< Sequence<Reference<XEventListener > > > SAL_CALL methodXEventListenersMul( const Sequence<Sequence<Reference<XEventListener > > >& aSeq ) throw (RuntimeException); + virtual Sequence< sal_Int8 > SAL_CALL getAttrByte(void) throw( RuntimeException ); virtual void SAL_CALL setAttrByte(const Sequence< sal_Int8 >& AttrByte_) throw( RuntimeException ); virtual Sequence< float > SAL_CALL getAttrFloat(void) throw( RuntimeException) ; @@ -478,7 +480,33 @@ Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL OComponent::methodSequenc return aSeq; } +Sequence< Reference< XEventListener> > SAL_CALL OComponent::methodXEventListeners( const Sequence< Reference <XEventListener> >& aSeq) throw( RuntimeException) +{ + Reference<XEventListener> listener; + for( int i= 0; i < aSeq.getLength(); i++) + { + listener= aSeq[i]; + + listener->disposing( EventObject() ); + } + + return aSeq; +} +Sequence< Sequence<Reference<XEventListener > > > SAL_CALL OComponent::methodXEventListenersMul( const Sequence<Sequence<Reference<XEventListener > > >& aSeq ) throw (RuntimeException) +{ + Reference<XEventListener> listener; + for( int i= 0; i < aSeq.getLength(); i++) + { + Sequence<Reference<XEventListener> > seqInner= aSeq[i]; + for( int j= 0; j < seqInner.getLength(); j++) + { + listener= seqInner[j]; + listener->disposing( EventObject() ); + } + } + return aSeq; +} //--------------------------------------------------------------------------------------------- diff --git a/extensions/test/ole/idl/oletest.idl b/extensions/test/ole/idl/oletest.idl index 66aa413f2..e4b592d19 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.5 $ + * $Revision: 1.6 $ * - * last change: $Author: jl $ $Date: 2001-12-03 13:57:04 $ + * last change: $Author: jl $ $Date: 2002-06-05 13:14:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,7 @@ #include <com/sun/star/script/XInvocation.idl> //#include <stardiv/uno/beans/propset.idl> #include <com/sun/star/beans/XPropertySet.idl> +#include <com/sun/star/lang/XEventListener.idl> module oletest { @@ -83,6 +84,8 @@ interface XTestSequence: com::sun::star::uno::XInterface sequence<com::sun::star::uno::XInterface> methodXInterface ( [in] sequence<com::sun::star::uno::XInterface> aSeq); sequence< sequence <long> > methodSequence( [in] sequence< sequence< long > > aSeq); sequence< sequence <sequence <long> > > methodSequence2( [in] sequence< sequence< sequence<long> > > aSeq); + sequence< com::sun::star::lang::XEventListener > methodXEventListeners( [in] sequence<com::sun::star::lang::XEventListener> aSeq); + sequence< sequence< com::sun::star::lang::XEventListener > > methodXEventListenersMul( [in] sequence< sequence< com::sun::star::lang::XEventListener> > aSeq); [attribute] sequence<byte> AttrByte; [attribute] sequence<float> AttrFloat; |