diff options
Diffstat (limited to 'extensions/test/ole')
38 files changed, 609 insertions, 609 deletions
diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.cpp b/extensions/test/ole/AxTestComponents/AxTestComponents.cpp index 283cffd5f0bc..7d82204aa917 100644 --- a/extensions/test/ole/AxTestComponents/AxTestComponents.cpp +++ b/extensions/test/ole/AxTestComponents/AxTestComponents.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,7 +28,7 @@ // Note: Proxy/Stub Information -// To build a separate proxy/stub DLL, +// To build a separate proxy/stub DLL, // run nmake -f AxTestComponentsps.mk in the project directory. #include "stdafx.h" @@ -96,6 +96,6 @@ STDAPI DllUnregisterServer(void) } -//VT_I4 size_t V_ERROR VARIANT VARIANT_FALSE CComVariant FADF_EMBEDDED +//VT_I4 size_t V_ERROR VARIANT VARIANT_FALSE CComVariant FADF_EMBEDDED /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/AxTestComponents/AxTestComponents.idl b/extensions/test/ole/AxTestComponents/AxTestComponents.idl index 707d85f58941..ad8cca5d2928 100644 --- a/extensions/test/ole/AxTestComponents/AxTestComponents.idl +++ b/extensions/test/ole/AxTestComponents/AxTestComponents.idl @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -124,37 +124,37 @@ import "ocidl.idl"; [id(70), helpstring("method inMulDimArrayByte2")] HRESULT inMulDimArrayByte2([in] SAFEARRAY(unsigned char) val); [id(71), helpstring("method outMore")] HRESULT outMore([out]long* val1, [out]long* val2); - [id(72), helpstring("method optional1")] + [id(72), helpstring("method optional1")] HRESULT optional1([in] long val1, [in, optional] VARIANT* val2); - [id(73), helpstring("method optional2")] + [id(73), helpstring("method optional2")] HRESULT optional2([out] long* val1, [out, optional] VARIANT* val2); - [id(74), helpstring("method optional3")] + [id(74), helpstring("method optional3")] HRESULT optional3([in, optional] VARIANT* val1, [in, optional] VARIANT* val2); - [id(75), helpstring("method optional4")] + [id(75), helpstring("method optional4")] HRESULT optional4([in, out, optional] VARIANT* val1, [in, out, optional] VARIANT* val2); - [id(76), helpstring("method optional5")] + [id(76), helpstring("method optional5")] HRESULT optional5([out, optional] VARIANT* val1, [out, optional] VARIANT* val2); //midl creates for val4 a BSTR "4" as default value in the TLB. The midl complains //but the error message seems to be not for this case. //in defaultvalue2 val4 has an VT_I4 in the TLB. This must be a bug! - [id(77), helpstring("method defaultvalue1")] - HRESULT defaultvalue1([in, defaultvalue(1)] long val1, + [id(77), helpstring("method defaultvalue1")] + HRESULT defaultvalue1([in, defaultvalue(1)] long val1, [in, defaultvalue(2)] double* val2, // [in, defaultvalue(3)] VARIANT val3, //ok [in, defaultvalue(4)] VARIANT* val4); // bug im midl: when val3 and val4 are pointers then the generated header cretates // for all params default values: - //HRESULT STDMETHODCALLTYPE defaultvalue2( + //HRESULT STDMETHODCALLTYPE defaultvalue2( // /* [defaultvalue][in] */ long *val1 = 10, // /* [defaultvalue][in] */ double *val2 = 3.14, // /* [defaultvalue][in] */ VARIANT *val3 = 10, // /* [defaultvalue][in] */ VARIANT *val4 = 100) = 0; - // And that does not compile. - //Therefore we must not include the midl generated header, instead use + // And that does not compile. + //Therefore we must not include the midl generated header, instead use // #import to create the interface header - [id(78), helpstring("method defaultvalue2")] - HRESULT defaultvalue2([in, out, defaultvalue(1)]long* val1, + [id(78), helpstring("method defaultvalue2")] + HRESULT defaultvalue2([in, out, defaultvalue(1)]long* val1, [in, out, defaultvalue(2)] double* val2, // [in, out, defaultvalue(3)] VARIANT *val3, [in, out, defaultvalue(4)] VARIANT *val4); @@ -164,7 +164,7 @@ import "ocidl.idl"; [id(80), helpstring("method varargfunc2")] HRESULT varargfunc2([out] long* val1, [out] SAFEARRAY(VARIANT)* val2); - + [id(86), helpstring("method inSequenceByteDim2")] HRESULT inSequenceByteDim2([in] SAFEARRAY(byte) val); [id(87), helpstring("method inCurrency")] HRESULT inCurrency([in] CY val); [id(88), helpstring("method outCurrency")] HRESULT outCurrency([out] CY* val); @@ -195,9 +195,9 @@ import "ocidl.idl"; [propputref, id(107), helpstring("property prprefVariant")] HRESULT prprefVariant([in] VARIANT* newVal); [propget, id(108), helpstring("property prprefDecimal")] HRESULT prprefDecimal([out, retval] DECIMAL* pVal); [propputref, id(108), helpstring("property prprefDecimal")] HRESULT prprefDecimal([in] DECIMAL* newVal); - [id(109), helpstring("method optional6")] HRESULT optional6([in,optional] VARIANT* val1, + [id(109), helpstring("method optional6")] HRESULT optional6([in,optional] VARIANT* val1, [in,optional] VARIANT * val2, [in,optional] VARIANT* val3, [in,optional] VARIANT* val4); - [id(110), helpstring("method optional7")] HRESULT optional7([out,optional] VARIANT* val1, + [id(110), helpstring("method optional7")] HRESULT optional7([out,optional] VARIANT* val1, [out,optional] VARIANT * val2, [out,optional] VARIANT* val3, [out,optional] VARIANT* val4); [propget, id(111), helpstring("property prpMultiArg1")] HRESULT prpMultiArg1([in,out,optional] VARIANT* val1, [in,out,optional] VARIANT* val2, [out, optional, retval] VARIANT* pVal); diff --git a/extensions/test/ole/AxTestComponents/Basic.cpp b/extensions/test/ole/AxTestComponents/Basic.cpp index 4fa950922801..fab6e68f59c0 100644 --- a/extensions/test/ole/AxTestComponents/Basic.cpp +++ b/extensions/test/ole/AxTestComponents/Basic.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -32,7 +32,7 @@ ///////////////////////////////////////////////////////////////////////////// // CBasic -CBasic::CBasic(): m_cPrpByte(0),m_nPrpShort(0),m_lPrpLong(0),m_fPrpFloat(0), m_dPrpDouble(0),m_PrpArray(0), +CBasic::CBasic(): m_cPrpByte(0),m_nPrpShort(0),m_lPrpLong(0),m_fPrpFloat(0), m_dPrpDouble(0),m_PrpArray(0), m_safearray(NULL), m_bool(VARIANT_FALSE), m_arByte(0), m_arShort(0), m_arLong(0), m_arString(0), m_arVariant(0), m_arFloat(0), m_arDouble(0), m_arObject(0), m_arByteDim2(0), m_date(0.), m_scode(0) @@ -103,7 +103,7 @@ STDMETHODIMP CBasic::inDouble(double val) STDMETHODIMP CBasic::inVariant(VARIANT val) { - m_var1 = val; + m_var1 = val; return S_OK; } @@ -210,7 +210,7 @@ STDMETHODIMP CBasic::inoutArray(LPSAFEARRAY *val) STDMETHODIMP CBasic::inoutObject(IDispatch **val) { - CComPtr<IDispatch> disp = *val; + CComPtr<IDispatch> disp = *val; if (*val) (*val)->Release(); *val = m_obj; @@ -284,7 +284,7 @@ STDMETHODIMP CBasic::outObject(IDispatch* *val) *val = m_obj; if (m_obj) (*val)->AddRef(); - + return S_OK; } @@ -439,7 +439,7 @@ STDMETHODIMP CBasic::put_prpObject(IDispatch *newVal) return S_OK; } -STDMETHODIMP CBasic::mixed1( +STDMETHODIMP CBasic::mixed1( /* [out][in] */ unsigned char *aChar, /* [out][in] */ float *aFloat, /* [out][in] */ VARIANT *aVar) @@ -537,13 +537,13 @@ void CBasic::printArray( LPSAFEARRAY val, BSTR message, VARTYPE type) hr= SafeArrayGetLBound( val, 1, &lbound); hr= SafeArrayGetUBound( val, 1, &ubound); long length= ubound - lbound +1; - + CComVariant varElement; char buf[1024]; sprintf( buf,"%s", W2A(message)); for( long i= 0; i < length ; i++) - { + { char tmp[1024]; long data=0; CComVariant var; @@ -573,7 +573,7 @@ void CBasic::printArray( LPSAFEARRAY val, BSTR message, VARTYPE type) sprintf( tmp, "%f \n", *(double*) &data); break; case VT_DISPATCH: - // we assume the objects are instances of this component and have the + // we assume the objects are instances of this component and have the // property prpString set. hr= SafeArrayGetElement( val, &i, (void*)&data); IDispatch* pdisp= ( IDispatch*) data; @@ -590,8 +590,8 @@ void CBasic::printArray( LPSAFEARRAY val, BSTR message, VARTYPE type) strcat( buf, tmp); } - MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK); - + MessageBox( NULL, _T(A2T(buf)), _T("AxTestComponents.Basic"), MB_OK); + } // V_ERROR OLECHAR VARIANT VT_UI1 @@ -765,7 +765,7 @@ STDMETHODIMP CBasic::inMulDimArrayByte(LPSAFEARRAY val) // 3-dimensionales array STDMETHODIMP CBasic::inMulDimArrayByte2(LPSAFEARRAY val) { - + // TODO: Add your implementation code here //printMulArray( val, VT_UI1); return S_OK; @@ -829,7 +829,7 @@ void CBasic::printMulArray( SAFEARRAY* val, VARTYPE type) } - + } else if( dims == 3 ) { @@ -921,12 +921,12 @@ STDMETHODIMP CBasic::optional3(/*[in, optional]*/ VARIANT* val1,/*[in, optional] { //if (val1->vt != VT_ERROR) m_var1 = *val1; - + //if (val2->vt != VT_ERROR) m_var2 = *val2; return S_OK; } - + STDMETHODIMP CBasic::optional4(/*[in, out, optional]*/ VARIANT* val1, /*[in, out, optional]*/ VARIANT* val2) { @@ -967,7 +967,7 @@ STDMETHODIMP CBasic::defaultvalue1(/*[in, defaultvalue(10)]*/ long val1, { m_long = val1; m_double = *val2; -// m_var1 = val3; +// m_var1 = val3; m_var2 = *val4; return S_OK; } @@ -979,17 +979,17 @@ STDMETHODIMP CBasic::defaultvalue2(/*[in, out, defaultvalue(10)]*/ long* val1, HRESULT hr = S_OK; long aLong = *val1; double aDouble = *val2; -// CComVariant var1(*val3); +// CComVariant var1(*val3); CComVariant var2(*val4); *val1 = m_long; *val2 = m_double; //if (FAILED(hr = VariantCopy(val3, &m_var1))) - // return hr; + // return hr; if (FAILED(hr = VariantCopy(val4, &m_var2))) return hr; m_long = aLong; m_double = aDouble; -// m_var1 = var1; +// m_var1 = var1; m_var2 = var2; return hr; } @@ -1006,7 +1006,7 @@ STDMETHODIMP CBasic::varargfunc1(/*[in]*/ long val1,/*[in]*/ LPSAFEARRAY val2) if (FAILED(hr = SafeArrayCopy(val2, & m_safearray))) { if (hr != E_INVALIDARG) - return hr; + return hr; } return S_OK; } @@ -1187,7 +1187,7 @@ STDMETHODIMP CBasic::get_prpRefLong(long* pVal) STDMETHODIMP CBasic::putref_prpRefLong(long* newVal) { - m_long = * newVal; + m_long = * newVal; return S_OK; } @@ -1242,7 +1242,7 @@ STDMETHODIMP CBasic::optional7(VARIANT* val1, VARIANT* val2, VARIANT* val3, VARI return hr; if (FAILED(hr = VariantCopy(val4, & m_var4))) return hr; - + return S_OK; } diff --git a/extensions/test/ole/AxTestComponents/Basic.h b/extensions/test/ole/AxTestComponents/Basic.h index 08d63062f13b..eb67ce8bbb21 100644 --- a/extensions/test/ole/AxTestComponents/Basic.h +++ b/extensions/test/ole/AxTestComponents/Basic.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ ///////////////////////////////////////////////////////////////////////////// // CBasic -class ATL_NO_VTABLE CBasic : +class ATL_NO_VTABLE CBasic : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CBasic, &CLSID_Basic>, public IDispatchImpl<IBasic, &IID_IBasic, &LIBID_AXTESTCOMPONENTSLib> @@ -54,7 +54,7 @@ public: END_COM_MAP() // IBasic -public: +public: STDMETHOD(outMore)(/*[out]*/long* val1, /*[out]*/long* val2); STDMETHOD(inMulDimArrayByte2)(LPSAFEARRAY val); STDMETHOD(inMulDimArrayByte)(LPSAFEARRAY val); @@ -83,7 +83,7 @@ public: STDMETHOD(inSequenceShort)(LPSAFEARRAY ar); STDMETHOD(inSequenceByte)(LPSAFEARRAY ar); STDMETHOD(inSequenceLong)(LPSAFEARRAY ar); - STDMETHOD(mixed1)( + STDMETHOD(mixed1)( /* [out][in] */ unsigned char *aChar, /* [out][in] */ float *aFloat, /* [out][in] */ VARIANT *aVar); diff --git a/extensions/test/ole/AxTestComponents/Foo.cpp b/extensions/test/ole/AxTestComponents/Foo.cpp index 6d6ae3b7a0bd..6eacea7727be 100644 --- a/extensions/test/ole/AxTestComponents/Foo.cpp +++ b/extensions/test/ole/AxTestComponents/Foo.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/extensions/test/ole/AxTestComponents/Foo.h b/extensions/test/ole/AxTestComponents/Foo.h index 375d09878fa9..a4024ea01a7a 100644 --- a/extensions/test/ole/AxTestComponents/Foo.h +++ b/extensions/test/ole/AxTestComponents/Foo.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,12 +35,12 @@ ///////////////////////////////////////////////////////////////////////////// // CBasic -class ATL_NO_VTABLE CFoo : +class ATL_NO_VTABLE CFoo : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CFoo, &CLSID_Foo>, public IFoo -// public IDispatchImpl<IFoo, &__uuidof(IFoo), &LIBID_AXTESTCOMPONENTSLib, /* wMajor = */ 1, /* wMinor = */ 0> +// public IDispatchImpl<IFoo, &__uuidof(IFoo), &LIBID_AXTESTCOMPONENTSLib, /* wMajor = */ 1, /* wMinor = */ 0> { public: CFoo(); diff --git a/extensions/test/ole/AxTestComponents/StdAfx.cpp b/extensions/test/ole/AxTestComponents/StdAfx.cpp index 36dc86fc2eba..d881698b27d3 100644 --- a/extensions/test/ole/AxTestComponents/StdAfx.cpp +++ b/extensions/test/ole/AxTestComponents/StdAfx.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/extensions/test/ole/AxTestComponents/StdAfx.h b/extensions/test/ole/AxTestComponents/StdAfx.h index ab7782f42659..a46eeeb618af 100644 --- a/extensions/test/ole/AxTestComponents/StdAfx.h +++ b/extensions/test/ole/AxTestComponents/StdAfx.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/extensions/test/ole/AxTestComponents/resource.h b/extensions/test/ole/AxTestComponents/resource.h index a3c9b0c20f46..b926189183ec 100644 --- a/extensions/test/ole/AxTestComponents/resource.h +++ b/extensions/test/ole/AxTestComponents/resource.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ //#define IDR_FOO 501 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 201 diff --git a/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp b/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp index 768f9ec29b68..9512ec4c2372 100644 --- a/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp +++ b/extensions/test/ole/EventListenerSample/EventListener/EventListener.cpp @@ -3,7 +3,7 @@ // Note: Proxy/Stub Information -// To build a separate proxy/stub DLL, +// To build a separate proxy/stub DLL, // run nmake -f EventListenerps.mk in the project directory. #include "stdafx.h" diff --git a/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h index 24552b9a9641..2bc0a6a9aef9 100644 --- a/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h +++ b/extensions/test/ole/EventListenerSample/EventListener/EvtListener.h @@ -8,7 +8,7 @@ ///////////////////////////////////////////////////////////////////////////// // CEvtListener -class ATL_NO_VTABLE CEvtListener : +class ATL_NO_VTABLE CEvtListener : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CEvtListener, &CLSID_EvtListener>, public IDispatchImpl<IEvtListener, &IID_IEvtListener, &LIBID_EVENTLISTENERLib> diff --git a/extensions/test/ole/EventListenerSample/EventListener/resource.h b/extensions/test/ole/EventListenerSample/EventListener/resource.h index fef53bef1f1f..70bf51a6f1ff 100644 --- a/extensions/test/ole/EventListenerSample/EventListener/resource.h +++ b/extensions/test/ole/EventListenerSample/EventListener/resource.h @@ -7,7 +7,7 @@ #define IDR_EVTLISTENER 101 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 201 diff --git a/extensions/test/ole/MfcControl/MfcControlCtl.cpp b/extensions/test/ole/MfcControl/MfcControlCtl.cpp index 9aab5e79a3ac..399fb5db95c2 100644 --- a/extensions/test/ole/MfcControl/MfcControlCtl.cpp +++ b/extensions/test/ole/MfcControl/MfcControlCtl.cpp @@ -196,7 +196,7 @@ void CMfcControlCtrl::OnResetState() // CMfcControlCtrl message handlers -short CMfcControlCtrl::inShort(short val) +short CMfcControlCtrl::inShort(short val) { char buf[256]; sprintf( buf, "inByte: value= %d", val); @@ -204,7 +204,7 @@ short CMfcControlCtrl::inShort(short val) return val+1; } -long CMfcControlCtrl::inLong(long val) +long CMfcControlCtrl::inLong(long val) { char buf[256]; sprintf( buf, "inLong: value= %d", val); @@ -212,7 +212,7 @@ long CMfcControlCtrl::inLong(long val) return val+1; } -BSTR CMfcControlCtrl::inString(BSTR* val) +BSTR CMfcControlCtrl::inString(BSTR* val) { CString strResult; strResult= *val; @@ -223,7 +223,7 @@ BSTR CMfcControlCtrl::inString(BSTR* val) return strResult.AllocSysString(); } -float CMfcControlCtrl::inFloat(float val) +float CMfcControlCtrl::inFloat(float val) { char buf[256]; sprintf( buf, "inFloat: value= %f", val); @@ -231,7 +231,7 @@ float CMfcControlCtrl::inFloat(float val) return val+1; } -double CMfcControlCtrl::inDouble(double val) +double CMfcControlCtrl::inDouble(double val) { char buf[256]; sprintf( buf, "inDouble: value= %g", val); @@ -239,7 +239,7 @@ double CMfcControlCtrl::inDouble(double val) return val+1; } -VARIANT CMfcControlCtrl::inVariant(const VARIANT FAR& val) +VARIANT CMfcControlCtrl::inVariant(const VARIANT FAR& val) { VARIANT vaResult; VariantInit(&vaResult); @@ -254,7 +254,7 @@ VARIANT CMfcControlCtrl::inVariant(const VARIANT FAR& val) return _variant_t( L" a string from CMfcControlCtrl::inVariant"); } -LPDISPATCH CMfcControlCtrl::inObject(LPDISPATCH val) +LPDISPATCH CMfcControlCtrl::inObject(LPDISPATCH val) { char buf[256]; _bstr_t bstr; @@ -278,47 +278,47 @@ LPDISPATCH CMfcControlCtrl::inObject(LPDISPATCH val) } -void CMfcControlCtrl::outShort(short* val) +void CMfcControlCtrl::outShort(short* val) { *val= 123; } -void CMfcControlCtrl::outLong(long* val) +void CMfcControlCtrl::outLong(long* val) { *val= 1234; } -void CMfcControlCtrl::outString(BSTR FAR* val) +void CMfcControlCtrl::outString(BSTR FAR* val) { - *val= SysAllocString(L"A string from CMfcControlCtrl::outString "); + *val= SysAllocString(L"A string from CMfcControlCtrl::outString "); } -void CMfcControlCtrl::outFloat(float* val) +void CMfcControlCtrl::outFloat(float* val) { *val= 3.14f; } -void CMfcControlCtrl::outDouble(double* val) +void CMfcControlCtrl::outDouble(double* val) { *val= 3.145; } -void CMfcControlCtrl::outVariant(VARIANT FAR* val) +void CMfcControlCtrl::outVariant(VARIANT FAR* val) { VariantInit( val); val->vt= VT_BSTR; val->bstrVal= SysAllocString( L"a string in a VARIANT"); } -void CMfcControlCtrl::outObject(LPDISPATCH FAR* val) +void CMfcControlCtrl::outObject(LPDISPATCH FAR* val) { //{BFE10EBE-8584-11D4-005004526AB4} HRESULT hr= S_OK; CLSID clsTestControl; - hr= CLSIDFromProgID( L"AxTestComponents.Basic", &clsTestControl); + hr= CLSIDFromProgID( L"AxTestComponents.Basic", &clsTestControl); IDispatch* pDisp= NULL; - hr= CoCreateInstance( clsTestControl, NULL, CLSCTX_ALL, __uuidof(IDispatch), (void**)&pDisp); + hr= CoCreateInstance( clsTestControl, NULL, CLSCTX_ALL, __uuidof(IDispatch), (void**)&pDisp); if( SUCCEEDED( hr) && val) { diff --git a/extensions/test/ole/MfcControl/MfcControlCtl.h b/extensions/test/ole/MfcControl/MfcControlCtl.h index ea06425a3fcd..f6d4379658b9 100644 --- a/extensions/test/ole/MfcControl/MfcControlCtl.h +++ b/extensions/test/ole/MfcControl/MfcControlCtl.h @@ -35,7 +35,7 @@ protected: DECLARE_OLECREATE_EX(CMfcControlCtrl) // Class factory and guid DECLARE_OLETYPELIB(CMfcControlCtrl) // GetTypeInfo DECLARE_PROPPAGEIDS(CMfcControlCtrl) // Property page IDs - DECLARE_OLECTLTYPE(CMfcControlCtrl) // Type name and misc status + DECLARE_OLECTLTYPE(CMfcControlCtrl) // Type name and misc status // Message maps //{{AFX_MSG(CMfcControlCtrl) diff --git a/extensions/test/ole/MfcControl/StdAfx.h b/extensions/test/ole/MfcControl/StdAfx.h index b0a8f50346c7..4df599c412e3 100644 --- a/extensions/test/ole/MfcControl/StdAfx.h +++ b/extensions/test/ole/MfcControl/StdAfx.h @@ -10,19 +10,19 @@ // or project specific include files that are used frequently, // but are changed infrequently -#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers #include <afxctl.h> // MFC support for ActiveX Controls #include <afxext.h> // MFC extensions -#include <afxdtctl.h> // MFC support for Internet Explorer 4 Comon Controls +#include <afxdtctl.h> // MFC support for Internet Explorer 4 Comon Controls #ifndef _AFX_NO_AFXCMN_SUPPORT -#include <afxcmn.h> // MFC support for Windows Common Controls +#include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT // Delete the two includes below if you do not wish to use the MFC // database classes -#include <afxdb.h> // MFC database classes -#include <afxdao.h> // MFC DAO database classes +#include <afxdb.h> // MFC database classes +#include <afxdao.h> // MFC DAO database classes //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. diff --git a/extensions/test/ole/OleClient/axhost.cxx b/extensions/test/ole/OleClient/axhost.cxx index 5c96023af26c..93d5721b3b49 100644 --- a/extensions/test/ole/OleClient/axhost.cxx +++ b/extensions/test/ole/OleClient/axhost.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/extensions/test/ole/OleClient/axhost.hxx b/extensions/test/ole/OleClient/axhost.hxx index 9857eaa8e28d..88b870f849c5 100644 --- a/extensions/test/ole/OleClient/axhost.hxx +++ b/extensions/test/ole/OleClient/axhost.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ extern CComModule _Module; #include <atlhost.h> -class HostWin: public CWindowImpl<HostWin, CWindow, +class HostWin: public CWindowImpl<HostWin, CWindow, CWinTraits< WS_CAPTION|WS_POPUPWINDOW|WS_VISIBLE, 0> > { CComBSTR controlName; diff --git a/extensions/test/ole/OleClient/clientTest.cxx b/extensions/test/ole/OleClient/clientTest.cxx index 684644e47cec..4a79eead82df 100644 --- a/extensions/test/ole/OleClient/clientTest.cxx +++ b/extensions/test/ole/OleClient/clientTest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,7 +92,7 @@ extern "C" int __cdecl main( int , char **) return -1; } - + _Module.Init( ObjectMap, GetModuleHandle( NULL)); if( FAILED(hr=doTest())) @@ -152,17 +152,17 @@ bool doParameterTest(const Reference<XInvocation> & inv) Sequence<Any> seqNamed5(arArgs, 1); arArgs[0] <<= arg2; Sequence<Any> seqNamed6(arArgs, 1); - + arArgs[0] <<= (sal_Int32) 123; arArgs[1] <<= (sal_Int32) 456; Sequence<Any> seqPositional(arArgs, 2); arArgs[0] <<= (sal_Int32) 123; Sequence<Any> seqPositional2(arArgs, 1); - + arArgs[0] <<= Any(); arArgs[1] <<= Any(); Sequence<Any> seqPositional3(arArgs, 2); - + arArgs[0] <<= (sal_Int32) 123; arArgs[1] <<= SCode(DISP_E_PARAMNOTFOUND); Sequence<Any> seqOutOpt1(arArgs, 2); @@ -180,7 +180,7 @@ bool doParameterTest(const Reference<XInvocation> & inv) arArgs1[2] <<= (sal_Int32) 0; arArgs1[3] <<= (sal_Int32) 0; Sequence<Any> seqMix0(arArgs1, 4); - + arArgs1[0] <<= (sal_Int32) 123; arArgs1[1] <<= (sal_Int32) 456; arArgs1[2] <<= arg3; @@ -215,7 +215,7 @@ bool doParameterTest(const Reference<XInvocation> & inv) inv->invoke(OUString(L"optional5"), seqPositional, seqIndices, seqOut); if ( ! checkOutArgs(seqOut, seqIndices, seqPositional)) return false; - + //2 optional args, 1 provided seqIndices.realloc(0); seqOut.realloc(0); @@ -241,7 +241,7 @@ bool doParameterTest(const Reference<XInvocation> & inv) inv->invoke(OUString(L"optional5"), seqPositional3, seqIndices, seqOut); if ( ! checkOutArgs(seqOut, seqIndices, seqOutOpt2)) return false; - + //named args -------------------------------------------- // 2 named args, correct position @@ -289,7 +289,7 @@ bool doParameterTest(const Reference<XInvocation> & inv) inv->invoke(OUString(L"optional5"), seqNamed4, seqIndices, seqOut); if ( ! checkOutArgs(seqOut, seqIndices, seqNamed2 )) return false; - + //2 args, 1 provided (correct order) seqIndices.realloc(0); @@ -351,8 +351,8 @@ bool doParameterTest(const Reference<XInvocation> & inv) inv->invoke(OUString(L"optional7"), seqMix2Out, seqIndices, seqOut); if ( ! checkOutArgs(seqOut, seqIndices, seqMix2Out)) return false; - - + + return true; } bool doPropertyTest(const Reference<XInvocation> & inv) @@ -379,7 +379,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) Any inrefDecimal, outrefDecimal; Any inParamsLong, outParamsLong; Reference<XInterface> xintUnknown(getComObject(L"AxTestComponents.Foo")); - + inBool <<= (sal_Bool) sal_True; inv->setValue(OUString(L"prpBool"), inBool); outBool = inv->getValue(OUString(L"prpBool")); @@ -393,7 +393,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) outShort = inv->getValue(OUString(L"prpShort")); inLong <<= ( sal_Int32) 1234567; - inv->setValue(OUString(L"prpLong"), inLong // TODO: Add your implementation code here + inv->setValue(OUString(L"prpLong"), inLong // TODO: Add your implementation code here ); outLong = inv->getValue(OUString(L"prpLong")); @@ -420,7 +420,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) inUnknown <<= xintUnknown; inv->setValue(OUString(L"prpUnknown"), inUnknown); outUnknown = inv->getValue(OUString(L"prpUnknown")); - + Currency cur(99999); inCY <<= cur; inv->setValue(OUString(L"prpCurrency"), inCY); @@ -444,7 +444,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) inrefLong <<= (sal_Int32) 123456; inv->setValue(OUString(L"prprefLong"), inrefLong); outrefLong = inv->getValue(OUString(L"prprefLong")); - + inrefVariant <<= OUString(L"A string in an any"); inv->setValue(OUString(L"prprefVariant"), inrefVariant); outrefVariant = inv->getValue(OUString(L"prprefVariant")); @@ -456,7 +456,7 @@ bool doPropertyTest(const Reference<XInvocation> & inv) if (inBool != outBool || inByte != outByte || inShort != outShort || inLong != outLong || inFloat != outFloat || inDouble != outDouble || inString != outString - || inVariant != outVariant || inObject != outObject + || inVariant != outVariant || inObject != outObject || inUnknown != outUnknown || inCY != outCY || inDate != outDate || inDecimal != outDecimal || inSCode != outSCode || inrefLong != outrefLong ||inrefVariant != outrefVariant @@ -486,7 +486,7 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) Sequence<Any> seqMultiArgPut2(arMultiArgs, 2); arMultiArgs[0] <<= NamedArgument(OUString(L"val2"), makeAny((sal_Int32) 1)); - arMultiArgs[1] <<= PropertyPutArgument(makeAny((sal_Int32) 3)); + arMultiArgs[1] <<= PropertyPutArgument(makeAny((sal_Int32) 3)); Sequence<Any> seqMultiArgPut3(arMultiArgs, 2); arMultiArgs[0] <<= NamedArgument(OUString(L"val2"), makeAny((sal_Int32) 1)); @@ -501,12 +501,12 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) arMultiArgs[1] <<= makeAny((sal_Int32) 2); Sequence<Any> seqMultiArgGet1(arMultiArgs, 2); Sequence<Any> seqMultiArgGet2(arMultiArgs, 1); - + arMultiArgs[0] <<= makeAny((sal_Int32) 0); arMultiArgs[1] <<= PropertyPutArgument(makeAny((sal_Int32) 0)); Sequence<Any> seqMultiArgPut5(arMultiArgs, 2); - + arMultiArgs[0] <<= makeAny((sal_Int32) 1); arMultiArgs[1] <<= PropertyPutArgument(makeAny((sal_Int32) 2)); Sequence<Any> seqMultiArgPut6(arMultiArgs, 2); @@ -518,7 +518,7 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) arMultiArgs[0] = makeAny((sal_Int32) 0); arMultiArgs[1] = makeAny((sal_Int32) 0); Sequence<Any> seqMultiVoid2(arMultiArgs, 2); - + //[propput, ...] HRESULT prpMultiArg1([in,out,optional] VARIANT* val1, [in,out,optional] VARIANT* val2, [in] VARIANT* newVal); //[propget, ...] HRESULT prpMultiArg1([in,out,optional] VARIANT* val1, [in,out,optional] VARIANT* val2, [out, optional, retval] VARIANT* pVal); seqIndices.realloc( 0); @@ -552,7 +552,7 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) arMultiArgs[0] = makeAny((sal_Int32) 1); arMultiArgs[1] = makeAny((SCode(DISP_E_PARAMNOTFOUND))); - + if (anyRet != ((PropertyPutArgument const *) seqMultiArgPut2[1].getValue())->Value || ! checkOutArgs(seqOut, seqIndices, Sequence<Any>(arMultiArgs, 2))) { @@ -617,7 +617,7 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) if ( anyRet != ((PropertyPutArgument const*) seqMultiArgPut6[1].getValue())->Value || !checkOutArgs(seqOut, seqIndices, seqMultiArgGet2)) return false; - + //hasProperty, hasMethod if (inv->hasProperty(OUSTR("prpMultiArg1"))) @@ -631,7 +631,7 @@ bool doPropertyWithArgumentTest(const Reference<XInvocation> & inv) if ( ! inv->hasMethod(OUSTR("inLong"))) return false; - return true; + return true; } bool doSimpleTest(const Reference<XInvocation> & inv) { @@ -656,9 +656,9 @@ bool doSimpleTest(const Reference<XInvocation> & inv) Any inrefVariant, outrefVariant; Any inrefDecimal, outrefDecimal; - Reference<XInterface> xIntFoo(getComObject(L"AxTestComponents.Foo")); + Reference<XInterface> xIntFoo(getComObject(L"AxTestComponents.Foo")); //################################################################################### - // in and out parameter + // in and out parameter //################################################################################### sal_Bool aBool = sal_True; inBool.setValue(&aBool, getCppuBooleanType()); @@ -746,7 +746,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) seqOut.realloc(0); inv->invoke(OUString(L"outDate"), Sequence< Any > (& outDate, 1), seqIndices, seqOut); outDate <<= seqOut[0]; - + Decimal dec(3, 0, 0xffffffff, 0xffffffff, 0xfffffff0); inDecimal <<= dec; inv->invoke(OUString(L"inDecimal"), Sequence<Any>( & inDecimal, 1), seqIndices, seqOut); @@ -765,12 +765,12 @@ bool doSimpleTest(const Reference<XInvocation> & inv) if (inBool != outBool || inByte != outByte || inShort != outShort || inLong != outLong || inFloat != outFloat || inDouble != outDouble || inString != outString - || inVariant != outVariant || inObject != outObject || inUnknown != outUnknown + || inVariant != outVariant || inObject != outObject || inUnknown != outUnknown || inCY != outCY || inDate != outDate || inDecimal != outDecimal || inSCode != outSCode) return false; //################################################################################### - // in/out parameter + // in/out parameter //################################################################################### outBool = Any(); seqIndices.realloc( 0); @@ -783,7 +783,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) seqOut.realloc(0); inv->invoke(OUString(L"inoutByte"), Sequence< Any > ( & inByte, 1), seqIndices, seqOut); outByte <<= seqOut[0]; - + outShort = Any(); seqIndices.realloc( 0); seqOut.realloc(0); @@ -801,7 +801,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) seqOut.realloc(0); inv->invoke(OUString(L"inoutString"), Sequence< Any > ( & inString, 1), seqIndices, seqOut); outString <<= seqOut[0]; - + outFloat = Any(); seqIndices.realloc( 0); seqOut.realloc(0); @@ -837,7 +837,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) seqOut.realloc(0); inv->invoke(OUString(L"inoutDate"), Sequence< Any > ( & inDate, 1), seqIndices, seqOut); outDate <<= seqOut[0]; - + outDecimal = Any(); seqIndices.realloc( 0); seqOut.realloc(0); @@ -857,7 +857,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) return false; //################################################################################### - // in byref parameters + // in byref parameters //################################################################################### inrefLong <<= (sal_Int32) 1234; @@ -866,7 +866,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) seqOut.realloc(0); inv->invoke(OUString(L"outLong"), Sequence< Any > (& outrefLong, 1), seqIndices, seqOut); outrefLong <<= seqOut[0]; - + inrefVariant <<= OUString(L" A string in an any"); inv->invoke(OUString(L"inrefVariant"), Sequence< Any > ( & inrefVariant, 1), seqIndices, seqOut); seqIndices.realloc( 0); @@ -888,7 +888,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) //################################################################################### - // mixed parameter + // mixed parameter //################################################################################### // mixed1 seqIndices.realloc( 0); @@ -898,7 +898,7 @@ bool doSimpleTest(const Reference<XInvocation> & inv) param[1] = inFloat; param[2] = inVariant; inv->invoke(OUString(L"mixed1"), Sequence< Any >(param, 3), seqIndices, seqOut); - + if (seqOut.getLength() != 3 || inByte != seqOut[0] || inFloat != seqOut[1] || inVariant != seqOut[2]) return false; @@ -911,7 +911,7 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) Sequence<sal_Int16> seqIndices; Sequence<Any> seqOut; Any voidAny; - Any inArAny; + Any inArAny; Any outArray; Any inArBool, outArBool; Any inArByte, outArByte; @@ -935,7 +935,7 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) Sequence<Any> seq_1( arAnyStrTmp, 3); inArAny <<= seq_1; //################################################################################### - // in, out Sequences + // in, out Sequences //################################################################################### //Test sequence containing Anys of Strings inv->invoke(OUString(L"inArray"), Sequence< Any > ( & inArAny, 1), seqIndices, seqOut); @@ -954,7 +954,7 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) sal_Int8 arByte[]={1,2,3}; Sequence<sal_Int8> seqByte(arByte, 3); inArByte <<= seqByte; - inv->invoke(OUString(L"inSequenceByte"),Sequence<Any>( & inArByte, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inSequenceByte"),Sequence<Any>( & inArByte, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceByte"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); @@ -963,7 +963,7 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) sal_Int16 arShort[]={4,5,6}; Sequence<sal_Int16> seqShort(arShort, 3); inArShort<<= seqShort; - inv->invoke(OUString(L"inSequenceShort"),Sequence< Any >( & inArShort, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inSequenceShort"),Sequence< Any >( & inArShort, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceShort"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); @@ -972,19 +972,19 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) sal_Int32 arLong[] = {7,8,9}; Sequence<sal_Int32> seqLong(arLong, 3); inArLong <<= seqLong; - inv->invoke(OUString(L"inSequenceLong"),Sequence< Any > ( & inArLong, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inSequenceLong"),Sequence< Any > ( & inArLong, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceLong"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); outArLong <<= seqOut[0]; - inv->invoke(OUString(L"inSequenceLong"),Sequence< Any > ( & inArLong, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inSequenceLong"),Sequence< Any > ( & inArLong, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceLong"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); outArLong <<= seqOut[0]; - inv->invoke( OUString(L"inSequenceString"),Sequence< Any > ( & inArString, 1), seqIndices, seqOut); + inv->invoke( OUString(L"inSequenceString"),Sequence< Any > ( & inArString, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceString"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); @@ -993,7 +993,7 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) float arFloat[]={3.14f, 31.4f, 314.f}; Sequence<float> seqFloat( arFloat, 3); inArFloat <<= seqFloat; - inv->invoke( OUString(L"inSequenceFloat"),Sequence< Any > ( & inArFloat, 1), seqIndices, seqOut); + inv->invoke( OUString(L"inSequenceFloat"),Sequence< Any > ( & inArFloat, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceFloat"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); @@ -1002,30 +1002,30 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) double arDouble[]={3.145, 31.45, 3145.}; Sequence<double> seqDouble( arDouble, 3); inArDouble <<= seqDouble; - inv->invoke(OUString(L"inSequenceDouble"),Sequence< Any >( & inArDouble, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inSequenceDouble"),Sequence< Any >( & inArDouble, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceDouble"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); outArDouble <<= seqOut[0]; Sequence<Reference<XInvocation> > seqObj(2); - seqObj[0]= getComObject(L"AxTestComponents.Basic"); - seqObj[1]= getComObject(L"AxTestComponents.Basic"); + seqObj[0]= getComObject(L"AxTestComponents.Basic"); + seqObj[1]= getComObject(L"AxTestComponents.Basic"); inArObject <<= seqObj; - inv->invoke(OUString(L"inSequenceObject"),Sequence< Any >( & inArObject, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inSequenceObject"),Sequence< Any >( & inArObject, 1), seqIndices, seqOut); seqIndices.realloc(0); seqOut.realloc(0); inv->invoke(OUString(L"outSequenceObject"), Sequence< Any >( & voidAny, 1), seqIndices, seqOut); outArObject <<= seqOut[0]; - - if ( ! equalSequences(inArByte, outArByte) || ! equalSequences(inArShort, outArShort) + + if ( ! equalSequences(inArByte, outArByte) || ! equalSequences(inArShort, outArShort) || ! equalSequences(inArLong, outArLong) || ! equalSequences(inArString, outArray) || ! equalSequences(inArFloat, outArFloat) || ! equalSequences(inArDouble, outArDouble) || ! equalSequences(inArString, outArString) || ! equalSequences(inArObject, outArObject)) return false; //################################################################################### - // in/out Sequences + // in/out Sequences //################################################################################### seqIndices.realloc(0); seqOut.realloc(0); @@ -1033,35 +1033,35 @@ bool doSimpleSequenceTest(const Reference<XInvocation> & inv) inv->invoke(OUString(L"inoutArray"), Sequence< Any >( & inArString, 1), seqIndices, seqOut); outArray <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceByte"), Sequence<Any>( & inArByte, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceByte"), Sequence<Any>( & inArByte, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceByte"), Sequence<Any>( & inArByte, 1), seqIndices, seqOut); outArByte <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceShort"), Sequence<Any>( & inArShort, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceShort"), Sequence<Any>( & inArShort, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceShort"), Sequence<Any>( & inArShort, 1), seqIndices, seqOut); outArShort <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceLong"), Sequence<Any>( & inArLong, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceLong"), Sequence<Any>( & inArLong, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceLong"), Sequence< Any >( & inArLong, 1), seqIndices, seqOut); outArLong <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceString"), Sequence<Any>( & inArString, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceString"), Sequence<Any>( & inArString, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceString"), Sequence<Any>( & inArString, 1), seqIndices, seqOut); outArString <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceFloat"), Sequence<Any>( & inArFloat, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceFloat"), Sequence<Any>( & inArFloat, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceFloat"), Sequence<Any>( & inArFloat, 1), seqIndices, seqOut); outArFloat <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceDouble"), Sequence<Any>( & inArDouble, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceDouble"), Sequence<Any>( & inArDouble, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceDouble"), Sequence<Any>( & inArDouble, 1), seqIndices, seqOut); outArDouble <<= seqOut[0]; - inv->invoke(OUString(L"inoutSequenceObject"), Sequence<Any>( & inArObject, 1), seqIndices, seqOut); + inv->invoke(OUString(L"inoutSequenceObject"), Sequence<Any>( & inArObject, 1), seqIndices, seqOut); inv->invoke(OUString(L"inoutSequenceObject"), Sequence<Any>( & inArObject, 1), seqIndices, seqOut); outArObject <<= seqOut[0]; - if ( ! equalSequences(inArByte, outArByte) || ! equalSequences(inArShort, outArShort) + if ( ! equalSequences(inArByte, outArByte) || ! equalSequences(inArShort, outArShort) || ! equalSequences(inArLong, outArLong) || ! equalSequences(inArString, outArray) || ! equalSequences(inArFloat, outArFloat) || ! equalSequences(inArDouble, outArDouble) || ! equalSequences(inArString, outArString) || ! equalSequences(inArObject, outArObject)) @@ -1082,7 +1082,7 @@ HRESULT doTest() Sequence< sal_Int16> seqIndices; Sequence<Any> seqOut; - + Any aAny; Any anyOut; char buff[1024]; @@ -1097,9 +1097,9 @@ HRESULT doTest() if (! doPropertyTest(inv)) { fprintf(stdout, "### Test failed!\n"); - return E_FAIL; + return E_FAIL; } - + if ( ! doSimpleSequenceTest(inv)) { fprintf(stdout, "### Test failed! \n"); @@ -1118,15 +1118,15 @@ HRESULT doTest() return E_FAIL; } - + // -// //################################################################################### -// // in multi Sequences -// //################################################################################### -// // inMulDimArrayLong +// //################################################################################### +// // in multi Sequences +// //################################################################################### +// // inMulDimArrayLong sal_Int32 arLongi[]={1,2,3}; sal_Int32 arLongi2[]={4,5,6,7}; sal_Int32 arLongi3[]={8,9,10,11,12}; @@ -1141,10 +1141,10 @@ HRESULT doTest() seq2i[2]= seqLongi3; seqAny<<= seq2i; // dimension length 3,5 - inv->invoke( OUString(L"inMulDimArrayLong"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); -// + inv->invoke( OUString(L"inMulDimArrayLong"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); +// //inMulDimArrayVariant - inv->invoke( OUString(L"inMulDimArrayVariant"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); + inv->invoke( OUString(L"inMulDimArrayVariant"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); //inMulDimArrayLong2 sal_Int32 arLongii1[]={1,2,3}; @@ -1167,12 +1167,12 @@ HRESULT doTest() seq2ii2[0]= seqLongii4; seq2ii2[1]= seqLongii5; - + Sequence< Sequence< Sequence< sal_Int32> > > seq3ii(2); seq3ii[0]=seq2ii; seq3ii[1]=seq2ii2; seqAny<<= seq3ii; - inv->invoke( OUString(L"inMulDimArrayLong2"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); + inv->invoke( OUString(L"inMulDimArrayLong2"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); // inMulDimArrayByte2 sal_Int8 arByteii1[]={1,2,3}; @@ -1195,27 +1195,27 @@ HRESULT doTest() seq2Byteii2[0]= seqByteii4; seq2Byteii2[1]= seqByteii5; - + Sequence< Sequence< Sequence< sal_Int8> > > seq3Byteii(2); seq3Byteii[0]=seq2Byteii; seq3Byteii[1]=seq2Byteii2; seqAny<<= seq3Byteii; - inv->invoke( OUString(L"inMulDimArrayByte2"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); + inv->invoke( OUString(L"inMulDimArrayByte2"),Sequence< Any > ( &seqAny, 1), seqIndices, seqOut); //################################################################################### //################################################################################### //################################################################################### - // Tests with a MFC ActiveX control, ( pure dispinterface) + // Tests with a MFC ActiveX control, ( pure dispinterface) //################################################################################### //################################################################################### - // in parameter MFC ActiveX + // in parameter MFC ActiveX //################################################################################### // unsigned char is not supported by MFC - // aAny <<= ( sal_Int8) 127; - // invMfc->invoke( OUString(L"inByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); + // aAny <<= ( sal_Int8) 127; + // invMfc->invoke( OUString(L"inByte"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); if ( ! invMfc.is()) return hr; aAny <<= static_cast<sal_Int16>(-1); @@ -1239,12 +1239,12 @@ HRESULT doTest() aAny <<= OUString( L" A string in an any"); aAny=invMfc->invoke( OUString(L"inVariant"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); - + // Tests with Sequences later. - // OUString arStr4[]= {L"string0", L"string1", L"string2"}; - // Sequence<OUString> seqStr4( arStr4, 3); - // aAny <<= seqStr4; - // invMfc->invoke( OUString(L"inArray"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); + // OUString arStr4[]= {L"string0", L"string1", L"string2"}; + // Sequence<OUString> seqStr4( arStr4, 3); + // aAny <<= seqStr4; + // invMfc->invoke( OUString(L"inArray"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); Reference < XInvocation > inv5= getComObject(L"AxTestComponents.Basic"); @@ -1254,11 +1254,11 @@ HRESULT doTest() aAny <<= inv5; aAny=invMfc->invoke( OUString(L"inObject"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); // -// //################################################################################### -// // out parameter MFC ActiveX -// //################################################################################### -// -// // outShort +// //################################################################################### +// // out parameter MFC ActiveX +// //################################################################################### +// +// // outShort aAny= invMfc->invoke( OUString(L"outShort"), Sequence< Any > ( &aAny, 1), seqIndices, seqOut); anyOut<<= seqOut[0]; sprintf(buff, "MFC outShort %d", *(sal_Int16*)anyOut.getValue()); @@ -1308,9 +1308,9 @@ HRESULT doTest() //################################################################################### - // Sequence parameter MFC ActiveX + // Sequence parameter MFC ActiveX //################################################################################### - // Sequences are not directly supported. + // Sequences are not directly supported. delete pWin; diff --git a/extensions/test/ole/OleClient/funcs.cxx b/extensions/test/ole/OleClient/funcs.cxx index 231f5bc825db..665814341d3e 100644 --- a/extensions/test/ole/OleClient/funcs.cxx +++ b/extensions/test/ole/OleClient/funcs.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ template< class T > bool equalSequences(const Sequence<T>& seqIn, const Sequence<Any> & returned); -Reference< XMultiServiceFactory > objectFactory;// +Reference< XMultiServiceFactory > objectFactory;// Reference<XMultiServiceFactory> getMultiServiceFactory() @@ -76,10 +76,10 @@ Reference<XInvocation> getComObject( OUString progId) { HRESULT hr= S_OK; Reference< XInvocation > ret; -// Reference<XMultiServiceFactory> fac; +// Reference<XMultiServiceFactory> fac; if( ! objectFactory.is()) - { Reference<XMultiServiceFactory> mgr= getMultiServiceFactory(); - Reference<XInterface> xInt= mgr->createInstance( + { Reference<XMultiServiceFactory> mgr= getMultiServiceFactory(); + Reference<XInterface> xInt= mgr->createInstance( OUString(L"com.sun.star.bridge.oleautomation.Factory")); objectFactory= Reference<XMultiServiceFactory>::query( xInt); } @@ -107,8 +107,8 @@ Reference<XInvocation> convertComObject( IUnknown* pUnk) any <<= ( sal_uInt32)&var; sal_uInt8 arId[16]; rtl_getGlobalProcessId( arId); - Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), OLE, UNO ); - + Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), OLE, UNO ); + Reference<XInvocation> ret; target>>= ret; return ret; @@ -121,7 +121,7 @@ Reference<XInvocation> convertComObject( IUnknown* pUnk) The number of items in value must be the same as the number of provided parameter during the call on the method. - + The parameter outArgs, indices correspond to the sequences which are arguments to XInvocation::invoke */ @@ -169,7 +169,7 @@ bool checkOutArgs(const Sequence<Any> & outArgs, return true; } -/* The returned sequence always contains Any elements +/* The returned sequence always contains Any elements */ bool equalSequences(const Any& orig, const Any& returned) { @@ -180,13 +180,13 @@ bool equalSequences(const Any& orig, const Any& returned) } TypeDescription td(orig.getValueTypeRef()); typelib_IndirectTypeDescription * indirect_td = (typelib_IndirectTypeDescription *) td.get(); - + switch (indirect_td->pType->eTypeClass) { case TypeClass_CHAR: { Sequence<sal_Unicode> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -194,7 +194,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_BOOLEAN: { Sequence<sal_Bool> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -202,7 +202,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_BYTE: { Sequence<sal_Int8> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -210,7 +210,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_SHORT: { Sequence<sal_Int16> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -218,7 +218,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_LONG: { Sequence<sal_Int32> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -226,7 +226,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_FLOAT: { Sequence<float> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -234,7 +234,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_DOUBLE: { Sequence<double> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -242,7 +242,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_STRING: { Sequence<OUString> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -250,7 +250,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_ANY: { Sequence<Any> seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -258,7 +258,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_SEQUENCE: { //Sequence<sal_Unicode> seq; - //orig >>= seq; + //orig >>= seq; //Sequence<Any> seq2; //returned >>= seq2; //return equalSequences(seq, seq2); @@ -267,7 +267,7 @@ bool equalSequences(const Any& orig, const Any& returned) case TypeClass_INTERFACE: { Sequence<Reference<XInvocation> > seq; - orig >>= seq; + orig >>= seq; Sequence<Any> seq2; returned >>= seq2; return equalSequences(seq, seq2); @@ -292,16 +292,16 @@ bool equalSequences(const Sequence<T>& seqIn, const Sequence<Any> & seqOut) if (anyIn != anyOut) return false; } - + return true; } void printSequence( Sequence<Any>& val) { -// typelib_TypeDescription* desc; -// val.getValueTypeDescription( &desc); -// typelib_typedescription_release( desc); +// typelib_TypeDescription* desc; +// val.getValueTypeDescription( &desc); +// typelib_typedescription_release( desc); USES_CONVERSION; char buff[1024]; diff --git a/extensions/test/ole/OleConverterVar1/convTest.cxx b/extensions/test/ole/OleConverterVar1/convTest.cxx index 6cc6e47462ac..7e89e660d40b 100644 --- a/extensions/test/ole/OleConverterVar1/convTest.cxx +++ b/extensions/test/ole/OleConverterVar1/convTest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -81,7 +81,7 @@ int __cdecl _tmain( int argc, _TCHAR * argv[] ) return -1; } - + _Module.Init( ObjectMap, GetModuleHandle( NULL)); if( FAILED(hr=doTest())) @@ -107,16 +107,16 @@ double _double[]= {12345, 1234.5, 123.45, 12.345, 1.2345}; CComVariant _variant[]= {L"variant 1", L"variant2", L"variant3"}; wchar_t _wchar[]= {L'1', L'2', L'3', L'A', L' '}; BSTR _bstr[]={L"Ich", L"bin", L"ein", L"Hamburger", L"Jung"}; -SmartArray<char> arByte( _c, 5, VT_I1); -SmartArray< short> arShort( _short, 5, VT_I2); +SmartArray<char> arByte( _c, 5, VT_I1); +SmartArray< short> arShort( _short, 5, VT_I2); //SmartArray< unsigned short> arUShort( _ushort, 5, VT_UI2); -SmartArray< long> arLong( _long, 5, VT_I4); -//SmartArray< unsigned long> arULong( _ulong, 5, VT_UI4); -//SmartArray< float> arFloat( _float, 5, VT_R4 ); -SmartArray< double> arDouble( _double, 5, VT_R8 ); +SmartArray< long> arLong( _long, 5, VT_I4); +//SmartArray< unsigned long> arULong( _ulong, 5, VT_UI4); +//SmartArray< float> arFloat( _float, 5, VT_R4 ); +SmartArray< double> arDouble( _double, 5, VT_R8 ); //SmartArray< unsigned short> arWChar( _wchar, 5, VT_UI2 ); -SmartArray< wchar_t* > arString( _bstr, 5, VT_BSTR); -SmartArray< VARIANT > arVariant( _variant, 3, VT_VARIANT); +SmartArray< wchar_t* > arString( _bstr, 5, VT_BSTR); +SmartArray< VARIANT > arVariant( _variant, 3, VT_VARIANT); HRESULT doTest() @@ -128,7 +128,7 @@ HRESULT doTest() putenv("UNO_TYPES=types.rdb"); putenv("UNO_SERVICES=services.rdb"); Reference<XComponentContext> xContext = defaultBootstrap_InitialComponentContext(); - + Reference< XMultiComponentFactory > mgr = xContext->getServiceManager();//createRegistryServiceFactory( OUString(L"services.rdb")); Reference< XInterface > xIntSupplier= mgr->createInstanceWithContext( OUString(L"com.sun.star.bridge.OleBridgeSupplierVar1"), xContext); @@ -139,12 +139,12 @@ HRESULT doTest() any <<= xOletest; sal_uInt8 arId[16]; rtl_getGlobalProcessId( arId); - Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), UNO, OLE); + Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), UNO, OLE); CComDispatchDriver oletest; if (target.getValueTypeClass() == getCppuType((sal_uInt32*) 0).getTypeClass()) { VARIANT* pVariant = *(VARIANT**)target.getValue(); - + oletest= pVariant->pdispVal; VariantClear(pVariant); @@ -156,22 +156,22 @@ HRESULT doTest() CComVariant varParam2; CComVariant varParam3; CComVariant varParam4; - + long value= 100; varParam1.vt= VT_I1 | VT_BYREF; varParam1.plVal= &value; - // Testing the caching of DISPIDs and the process of aquiring member information + // Testing the caching of DISPIDs and the process of aquiring member information // on demand in IDispatch::Invoke // Step through the corresponding IDispatch implementation of the ole bridge - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varParam1, &varRet); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varParam1, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varParam1, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varParam1, &varRet); // Name ok but different case - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout_methodByte"), &varParam1, &varRet); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout_methodByte"), &varParam1, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout_methodByte"), &varParam1, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout_methodByte"), &varParam1, &varRet); // not existing member - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout"), &varParam1, &varRet); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout"), &varParam1, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout"), &varParam1, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"Testinout"), &varParam1, &varRet); // Property varParam1.vt= VT_ARRAY | VT_I1; @@ -222,14 +222,14 @@ HRESULT doTest() LPOLESTR attrib= L"AttrByte"; hr = oletest.p->GetIDsOfNames(IID_NULL, &attrib, 1, LOCALE_USER_DEFAULT, &dispid); - + hr = oletest.p->Invoke( dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD | DISPATCH_PROPERTYPUTREF, ¶ms, &varRet, NULL, NULL); hr = oletest.p->Invoke( dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD | DISPATCH_PROPERTYGET, ¶ms, &varRet, NULL, NULL); - + CComVariant varByteArray; varByteArray.vt= VT_ARRAY | VT_I1; @@ -269,36 +269,36 @@ HRESULT doTest() CComVariant varUnkArray; varUnkArray.vt= VT_ARRAY | VT_UNKNOWN; varUnkArray.parray= (SAFEARRAY*)arUnknown; - + // preparing out parameter; char byteOut; - CComVariant varOutByte; //### + CComVariant varOutByte; //### varOutByte.vt= VT_BYREF | VT_UI1; V_I1REF(&varOutByte)= &byteOut; short shortOut; - CComVariant varOutShort; //### + CComVariant varOutShort; //### varOutShort.vt= VT_BYREF | VT_I2; V_I2REF( &varOutShort)= &shortOut; long longOut; - CComVariant varOutLong; //### + CComVariant varOutLong; //### varOutLong.vt= VT_BYREF | VT_I4; V_I4REF( &varOutLong)= &longOut; double doubleOut; - CComVariant varOutDouble; //### + CComVariant varOutDouble; //### varOutDouble.vt= VT_BYREF | VT_R8; V_R8REF( &varOutDouble)= &doubleOut; BSTR bstrOut= NULL; - CComVariant varOutString; //### + CComVariant varOutString; //### varOutString.vt= VT_BYREF | VT_BSTR; V_BSTRREF(&varOutString)= &bstrOut; CComVariant variantOut; - CComVariant varOutAny; //### + CComVariant varOutAny; //### varOutAny.vt= VT_BYREF | VT_VARIANT; V_VARIANTREF(&varOutAny)= &variantOut; CComPtr<IDispatch> dispOut; CComVariant varOutXInterface; //### - varOutXInterface.vt= VT_BYREF |VT_DISPATCH; + varOutXInterface.vt= VT_BYREF |VT_DISPATCH; V_DISPATCHREF(&varOutXInterface)= &dispOut.p; // In Parameter ( all of type Sequence ########################################################### @@ -307,43 +307,43 @@ HRESULT doTest() OutputDebugStringA("methodByte | Params: \n"); printVariant( varByteArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodByte"), &varByteArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodByte"), &varByteArray, &varRet); OutputDebugStringA("methodByte | return value \n"); printVariant( varRet); OutputDebugStringA("methodShort | Params: \n"); printVariant( varShortArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodShort"), &varShortArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodShort"), &varShortArray, &varRet); OutputDebugStringA("methodShort | return value \n"); printVariant( varRet); OutputDebugStringA("methodLong | Params: \n"); printVariant( varLongArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodLong"), &varLongArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodLong"), &varLongArray, &varRet); OutputDebugStringA("methodLong | return value \n"); printVariant( varRet); OutputDebugStringA("methodDouble | Params: \n"); printVariant( varDoubleArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodDouble"), &varDoubleArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodDouble"), &varDoubleArray, &varRet); OutputDebugStringA("methodDouble | return value \n"); printVariant( varRet); OutputDebugStringA("methodString | Params: \n"); printVariant( varStringArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodString"), &varStringArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodString"), &varStringArray, &varRet); OutputDebugStringA("methodString | return value \n"); printVariant( varRet); OutputDebugStringA("methodAny | Params: \n"); printVariant( varArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodAny"), &varArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodAny"), &varArray, &varRet); OutputDebugStringA("methodAny | return value \n"); printVariant( varRet); OutputDebugStringA("methodXInterface | Params: \n"); printVariant( varUnkArray); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodXInterface"), &varUnkArray, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"methodXInterface"), &varUnkArray, &varRet); OutputDebugStringA("methodAny | return value \n"); printVariant( varRet); @@ -351,44 +351,44 @@ HRESULT doTest() OutputDebugString( _T("Out parameter ###########################################\n\n")); OutputDebugString(_T("testout_methodByte \n")); - hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testout_methodByte"), &varOutByte, 1, &varRet); + hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testout_methodByte"), &varOutByte, 1, &varRet); OutputDebugString(_T("testout_methodByte | out value: \n")); printVariant( varOutByte); OutputDebugString(_T("testout_methodShort \n")); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodShort"), &varOutShort, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodShort"), &varOutShort, &varRet); OutputDebugString(_T("testout_methodShort | out value: \n")); printVariant( varOutShort); OutputDebugString(_T("testout_methodLong \n")); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodLong"), &varOutLong, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodLong"), &varOutLong, &varRet); OutputDebugString(_T("testout_methodLong | out value: \n")); printVariant( varOutLong); OutputDebugString(_T("testout_methodDouble \n")); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodDouble"), &varOutDouble, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodDouble"), &varOutDouble, &varRet); OutputDebugString(_T("testout_methodDouble | out value: \n")); printVariant( varOutDouble); OutputDebugString(_T("testout_methodString \n")); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodString"), &varOutString, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodString"), &varOutString, &varRet); OutputDebugString(_T("testout_methodString | out value: \n")); printVariant( varOutString); OutputDebugString(_T("testout_methodAny \n")); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodAny"), &varOutAny, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodAny"), &varOutAny, &varRet); OutputDebugString(_T("methodAny | out value: \n")); printVariant( varOutAny); OutputDebugString(_T("testout_methodXInterface \n")); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodXInterface"), &varOutXInterface, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testout_methodXInterface"), &varOutXInterface, &varRet); OutputDebugString(_T("methodAny | out value: \n")); printVariant( varOutXInterface); CComDispatchDriver outDisp( *varOutXInterface.ppdispVal); CComVariant varAttr3; outDisp.GetPropertyByName(L"AttrAny2", &varAttr3); ATLTRACE("property OleTest.AttrAny2: %s", W2T(varAttr3.bstrVal)); - + OutputDebugString(_T("testout_methodMulParams1 ( 2 out Parameter) \n")); long longOut2=0; CComVariant _params[2]; @@ -396,18 +396,18 @@ HRESULT doTest() _params[0]= varOutLong; _params[1].vt= VT_BYREF | VT_I4; V_I4REF(& _params[1])= &longOut2; - hr= oletest.InvokeN( static_cast<LPCOLESTR>(L"testout_methodMulParams1"), (VARIANT*)&_params, 2); + hr= oletest.InvokeN( static_cast<LPCOLESTR>(L"testout_methodMulParams1"), (VARIANT*)&_params, 2); OutputDebugString(_T("testout_methodMulParams1 | out values: \n")); printVariant( _params[1]); printVariant( _params[0]); - + OutputDebugString(_T("testout_methodMulParams2 ( 3 out Parameter) \n")); CComVariant _params2[3]; _params2[2]= varOutLong; _params2[1].vt= VT_BYREF | VT_I4; V_I4REF(& _params2[1])= &longOut2; _params2[0]= varOutString; - hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams2"), (VARIANT*)&_params2, 3); + hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams2"), (VARIANT*)&_params2, 3); OutputDebugString(_T("testout_methodMulParams2 | out values: \n")); printVariant( _params2[2]); printVariant( _params2[1]); @@ -417,42 +417,42 @@ HRESULT doTest() CComVariant _params3[2]; _params3[1]= CComBSTR(L" In string"); _params3[0]= varOutString; - hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams3"), (VARIANT*)&_params3, 2); + hr= oletest.InvokeN( static_cast<LPCOLESTR>( L"testout_methodMulParams3"), (VARIANT*)&_params3, 2); OutputDebugString(_T("testout_methodMulParams3 | out values: \n")); printVariant( _params3[1]); printVariant( _params3[0]); - + //In Out Parameter ########################################################################### OutputDebugString( _T("In Out parameter ###########################################\n\n")); *V_I1REF(&varOutByte)= 5; ATLTRACE(_T("testinout_methodByte | in value: %d \n"), *V_I1REF(&varOutByte)); - hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varOutByte, 1, &varRet); + hr= oletest.InvokeN(static_cast<LPCOLESTR>(L"testinout_methodByte"), &varOutByte, 1, &varRet); OutputDebugString(_T("testinout_methodByte | out value: \n")); printVariant( varOutByte); OutputDebugString(_T("testinout_methodShort | in value= 1000 \n")); *V_UI2REF(&varOutShort)= 1000; - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodShort"), &varOutShort, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodShort"), &varOutShort, &varRet); OutputDebugString(_T("testinout_methodShort | out value: \n")); printVariant( varOutShort); OutputDebugString(_T("testinout_methodLong | in value= 10000 \n")); *V_UI4REF(&varOutLong)= 10000; - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodLong"), &varOutLong, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodLong"), &varOutLong, &varRet); OutputDebugString(_T("testinout_methodLong | out value: \n")); printVariant( varOutLong); *V_R8REF(&varOutDouble)= 3.14; ATLTRACE(_T("testinou_methodDouble in value: %f \n"),*V_R8REF(&varOutDouble)); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodDouble"), &varOutDouble, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodDouble"), &varOutDouble, &varRet); OutputDebugString(_T("testinout_methodDouble | out value: \n")); printVariant( varOutDouble); SysFreeString( *V_BSTRREF(&varOutString)); *V_BSTRREF(&varOutString)= SysAllocString( L"this is a in string"); ATLTRACE(_T("testinout_methodString | value: %s \n"), W2T(*V_BSTRREF(&varOutString))); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodString"), &varOutString, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodString"), &varOutString, &varRet); OutputDebugString(_T("testinout_methodString | out value: \n")); printVariant( varOutString); @@ -461,7 +461,7 @@ HRESULT doTest() outVar1.vt= VT_BYREF | VT_VARIANT; outVar1.pvarVal= &var1; ATLTRACE(_T("testinout_methodAny | parameter: %s\n"), W2T(var1.bstrVal)); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodAny"), &varOutAny, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodAny"), &varOutAny, &varRet); OutputDebugString(_T("testinout_methodAny | out value: \n")); printVariant( varOutAny); @@ -472,7 +472,7 @@ HRESULT doTest() (*varOutIFace.ppunkVal)->AddRef(); OutputDebugString(_T("testinout_methodXInterface | in value: \n")); printVariant(varOutIFace); - hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodXInterface"), &varOutIFace, &varRet); + hr= oletest.Invoke1(static_cast<LPCOLESTR>(L"testinout_methodXInterface"), &varOutIFace, &varRet); OutputDebugString(_T("testinout_methodXInterface | out value: \n")); printVariant( varOutIFace); @@ -489,8 +489,8 @@ HRESULT doTest() varRet.Clear(); hr= oletest.GetPropertyByName( static_cast<LPCOLESTR>(L"AttrByte"), &varRet); printVariant( varRet); - - + + return S_OK; @@ -502,7 +502,7 @@ void printVariant( VARIANT & _var) HRESULT hr; USES_CONVERSION; CComVariant var; - hr= VariantCopyInd( &var, &_var); + hr= VariantCopyInd( &var, &_var); if( var.vt & VT_ARRAY) { VARTYPE type= var.vt ^ VT_ARRAY; @@ -522,7 +522,7 @@ void printVariant( VARIANT & _var) OutputDebugString( _T("# Array \n")); for( long i= 0; i < count; i++) { -// CComVariant variantValue; +// CComVariant variantValue; TCHAR *buf[256]; wsprintf( (TCHAR*)buf, _T("%d : "), i); OutputDebugString( (TCHAR*)buf); @@ -602,15 +602,15 @@ void printVariant( VARIANT & _var) break; case VT_I4: wsprintf( (TCHAR*)buf, _T(" VT_I4: %d \n"), V_I4( &var) ); break; - case VT_R8: + case VT_R8: { + +// int decimal, sign; +// char *buffer; +// int precision = 14; +// double source = 3.1415926535; -// int decimal, sign; -// char *buffer; -// int precision = 14; -// double source = 3.1415926535; - -// buffer = _ecvt( V_R8(&var), precision, &decimal, &sign ); +// buffer = _ecvt( V_R8(&var), precision, &decimal, &sign ); sprintf( (TCHAR*)buf, _T(" VT_R8: %f \n"),V_R8( &var) ); break; } @@ -635,7 +635,7 @@ void printVariant( VARIANT & _var) break; } - + case VT_BSTR: { diff --git a/extensions/test/ole/OleConverterVar1/smartarray.h b/extensions/test/ole/OleConverterVar1/smartarray.h index 13b5337cd11e..f38c93d88cd2 100644 --- a/extensions/test/ole/OleConverterVar1/smartarray.h +++ b/extensions/test/ole/OleConverterVar1/smartarray.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,14 +42,14 @@ public: rgsabound[0].cElements= count; rgsabound[0].lLbound= 0; m_array= SafeArrayCreate( destVartype, 1, rgsabound); - SafeArrayLock( m_array); - + SafeArrayLock( m_array); + void* pData; if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) ) { for( int i=0; i< count; i++) - { + { CComVariant varSource( parParams[i]); switch (destVartype) { @@ -121,18 +121,18 @@ public: VARIANT *pVariant= (VARIANT*)pData; hr= VariantCopy( &pVariant[i], &varSource); break; } -// case VT_UNKNOWN: -// { -// long* pUnk= (long*)pData; -// pUnk[i]= reinterpret_cast<long>(parParams[i]); -// ((IUnknown*)pUnk[i])->AddRef(); break; -// } -// case VT_DISPATCH: -// { -// long* pDisp= (long*)pData; -// pDisp[i]= (long)parParams[i]; -// ((IDispatch*)pDisp[i])->AddRef(); break; -// } +// case VT_UNKNOWN: +// { +// long* pUnk= (long*)pData; +// pUnk[i]= reinterpret_cast<long>(parParams[i]); +// ((IUnknown*)pUnk[i])->AddRef(); break; +// } +// case VT_DISPATCH: +// { +// long* pDisp= (long*)pData; +// pDisp[i]= (long)parParams[i]; +// ((IDispatch*)pDisp[i])->AddRef(); break; +// } default: hr= E_FAIL; } @@ -145,7 +145,7 @@ public: } SafeArrayUnaccessData( m_array); } - ~SmartArray(){ + ~SmartArray(){ SafeArrayUnlock( m_array); SafeArrayDestroy( m_array ); } @@ -162,44 +162,44 @@ class SmartArray<IUnknown*> SAFEARRAY *m_array; public: - SmartArray( sourceType * parParams, int count, VARTYPE destVartype); -// { -// ATLTRACE("SmartArray<IUnknown>"); -// HRESULT hr= S_OK; -// SAFEARRAYBOUND rgsabound[1]; -// rgsabound[0].cElements= count; -// rgsabound[0].lLbound= 0; -// m_array= SafeArrayCreateVector( VT_UNKNOWN, 0, count); -// SafeArrayLock( m_array); + SmartArray( sourceType * parParams, int count, VARTYPE destVartype); +// { +// ATLTRACE("SmartArray<IUnknown>"); +// HRESULT hr= S_OK; +// SAFEARRAYBOUND rgsabound[1]; +// rgsabound[0].cElements= count; +// rgsabound[0].lLbound= 0; +// m_array= SafeArrayCreateVector( VT_UNKNOWN, 0, count); +// SafeArrayLock( m_array); +// +// IUnknown* *pData; +// if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) ) +// { // -// IUnknown* *pData; -// if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) ) -// { +// for( int i=0; i< count; i++) +// { +// CComVariant varSource( parParams[i]); +// switch (destVartype) +// { // -// for( int i=0; i< count; i++) -// { -// CComVariant varSource( parParams[i]); -// switch (destVartype) -// { -// -// case VT_UNKNOWN: -// { -// pData[i]= parParams[i]; -// pData[i]->AddRef(); -// } -// default: -// hr= E_FAIL; -// } -// } -// if( FAILED( hr)) -// { -// SafeArrayDestroy( m_array); -// m_array= NULL; -// } -// } -// SafeArrayUnaccessData( m_array); -// } - ~SmartArray(){ +// case VT_UNKNOWN: +// { +// pData[i]= parParams[i]; +// pData[i]->AddRef(); +// } +// default: +// hr= E_FAIL; +// } +// } +// if( FAILED( hr)) +// { +// SafeArrayDestroy( m_array); +// m_array= NULL; +// } +// } +// SafeArrayUnaccessData( m_array); +// } + ~SmartArray(){ SafeArrayUnlock( m_array); SafeArrayDestroy( m_array ); } @@ -218,13 +218,13 @@ template <> SmartArray <IUnknown*>::SmartArray(sourceType * parParams, int count rgsabound[0].cElements= count; rgsabound[0].lLbound= 0; m_array= SafeArrayCreateVector( VT_UNKNOWN, 0, count); - SafeArrayLock( m_array); - + SafeArrayLock( m_array); + IUnknown* *pData; if( m_array && (SUCCEEDED( SafeArrayAccessData( m_array, (void**)&pData)) ) ) { for( int i=0; i< count; i++) - { + { pData[i]= parParams[i]; pData[i]->AddRef(); } diff --git a/extensions/test/ole/cpnt/cpnt.cxx b/extensions/test/ole/cpnt/cpnt.cxx index c44728b9def5..589d27f438c2 100644 --- a/extensions/test/ole/cpnt/cpnt.cxx +++ b/extensions/test/ole/cpnt/cpnt.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ using namespace oletest; using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -using namespace com::sun::star::beans; +using namespace com::sun::star::beans; using namespace com::sun::star::registry; using namespace com::sun::star::script; using namespace com::sun::star::reflection; @@ -136,7 +136,7 @@ class OComponent : public WeakImplHelper7< Reference<XInvocation> m_attr_xinvocation; public: - OComponent( const Reference<XMultiServiceFactory> & rFactory ) : + OComponent( const Reference<XMultiServiceFactory> & rFactory ) : m_rFactory( rFactory ), m_arrayConstructor(0) {} ~OComponent(); public: // XTestSequence @@ -157,7 +157,7 @@ public: // XTestSequence 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) ; @@ -263,7 +263,7 @@ public: // XTestSequence virtual void SAL_CALL setAttrAny2(const Any& AttrAny2_) throw( RuntimeException ) ; - // XTestStruct + // XTestStruct virtual void SAL_CALL methodStruct(const Property& aProp) throw( RuntimeException ); virtual Property SAL_CALL retMethodStruct(void) throw( RuntimeException ); @@ -280,25 +280,25 @@ public: // XTestSequence virtual Any SAL_CALL other_methodAny( const Any& rAny, const OUString& typeInAny ) throw (RuntimeException); - + // XTestOutParameters ------------------------------------------------------------------------ // virtual void SAL_CALL out_test(sal_Int8 rIn) throw( RuntimeException ); -// virtual void SAL_CALL out_methodByte(sal_Int8& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodFloat(float& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodDouble(double& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodBool(sal_Bool& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodShort(sal_Int16& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodUShort(sal_uInt16& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodLong(sal_Int32& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodULong(sal_uInt32& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodHyper(sal_Int64& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodUHyper(sal_uInt64& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodByte(sal_Int8& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodFloat(float& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodDouble(double& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodBool(sal_Bool& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodShort(sal_Int16& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodUShort(sal_uInt16& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodLong(sal_Int32& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodULong(sal_uInt32& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodHyper(sal_Int64& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodUHyper(sal_uInt64& rOut) throw( RuntimeException ); // virtual void SAL_CALL out_methodString(OUString& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodChar(sal_Unicode& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodAny(Any& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException ); -// virtual void SAL_CALL out_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodChar(sal_Unicode& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodAny(Any& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException ); +// virtual void SAL_CALL out_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException ); // virtual void SAL_CALL out_methodMulParams1(sal_Int32& rout1, sal_Int32& rout2) throw( RuntimeException ); // virtual void SAL_CALL out_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2, OUString& rout3) throw( RuntimeException ); // virtual void SAL_CALL out_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException ); @@ -322,7 +322,7 @@ public: // XTestSequence virtual Reference<XInvocation > SAL_CALL in_methodInvocation( const Reference< XInvocation >& inv ) throw (RuntimeException); virtual SimpleStruct SAL_CALL in_methodStruct( const SimpleStruct& aStruct ) throw (RuntimeException); virtual void SAL_CALL in_methodAll( sal_Int8 b, float f, double d, sal_Bool boo, sal_Int16 sh, sal_uInt16 us, sal_Int32 l, sal_uInt32 ul, const OUString& s, sal_Unicode c, const Any& a, const Type& t, const Reference<XInvocation>& inv ) throw (RuntimeException); - + // XTestInterfaces -------------------------------------------------------------------------- virtual void SAL_CALL testInterface( const Reference< XCallback >& xCallback, sal_Int32 mode ) throw(RuntimeException); virtual void SAL_CALL testInterface2( const Reference< XSimple >& xSimple, sal_Int32 mode ) throw(RuntimeException); @@ -355,10 +355,10 @@ OComponent::~OComponent() // Funktions ============================================================================== Reference<XInterface> SAL_CALL OComponent_CreateInstance( const Reference<XMultiServiceFactory> & rSMgr ) throw(RuntimeException) -{ -// Reference<XInterface> xService(static_cast<XWeak*>(new OComponent( rSMgr )), UNO_QUERY); +{ +// Reference<XInterface> xService(static_cast<XWeak*>(new OComponent( rSMgr )), UNO_QUERY); OComponent* o= new OComponent( rSMgr ); - Reference<XInterface> xService(static_cast<XIdentity*>(o), UNO_QUERY); + Reference<XInterface> xService(static_cast<XIdentity*>(o), UNO_QUERY); return xService; } @@ -366,12 +366,12 @@ Sequence<OUString> OComponent_getSupportedServiceNames(void) { Sequence<OUString> aRet(1); aRet.getArray()[0] = SERVICE_NAME;//ODataInputStream_getImplementationName(); - + return aRet; } -extern "C" sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) +extern "C" sal_Bool SAL_CALL component_writeInfo( void * /*pServiceManager*/, void * pRegistryKey ) { if(pRegistryKey) { @@ -402,11 +402,11 @@ extern "C" void * SAL_CALL component_getFactory( { Reference<XMultiServiceFactory> xMulFac( reinterpret_cast< XMultiServiceFactory*>(pServiceManager)); - - Sequence<OUString> seqServiceNames; - Reference<XSingleServiceFactory> xFactory = createOneInstanceFactory( xMulFac, SERVICE_NAME, + + Sequence<OUString> seqServiceNames; + Reference<XSingleServiceFactory> xFactory = createOneInstanceFactory( xMulFac, SERVICE_NAME, OComponent_CreateInstance, seqServiceNames); - + if (xFactory.is()) { xFactory->acquire(); @@ -414,7 +414,7 @@ extern "C" void * SAL_CALL component_getFactory( } } } - return pRet; + return pRet; } extern "C" void SAL_CALL component_getImplementationEnvironment( @@ -425,16 +425,16 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( // XTestSequence ============================================================================ -Sequence<sal_Int8> SAL_CALL OComponent::methodByte(const Sequence< sal_Int8 >& aSeq) throw( RuntimeException ) -{ +Sequence<sal_Int8> SAL_CALL OComponent::methodByte(const Sequence< sal_Int8 >& aSeq) throw( RuntimeException ) +{ sal_Int8 _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ _x= aSeq.getConstArray()[i]; } return aSeq; } -Sequence<float> SAL_CALL OComponent::methodFloat(const Sequence< float>& aSeq) throw( RuntimeException ) -{ +Sequence<float> SAL_CALL OComponent::methodFloat(const Sequence< float>& aSeq) throw( RuntimeException ) +{ float _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ _x= aSeq.getConstArray()[i]; @@ -468,12 +468,12 @@ Sequence< sal_Int16 > SAL_CALL OComponent::methodShort(const Sequence< sal_Int16 Sequence< sal_uInt16 > SAL_CALL OComponent::methodUShort(const Sequence< sal_uInt16 >& aSeq) throw( RuntimeException ) { sal_uInt16 _x; - for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ + for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ _x= aSeq.getConstArray()[i]; } return aSeq; } -Sequence< sal_Int32 > SAL_CALL OComponent::methodLong(const Sequence< sal_Int32 >& aSeq) throw( RuntimeException) +Sequence< sal_Int32 > SAL_CALL OComponent::methodLong(const Sequence< sal_Int32 >& aSeq) throw( RuntimeException) { sal_Int32 _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++) { @@ -481,7 +481,7 @@ Sequence< sal_Int32 > SAL_CALL OComponent::methodLong(const Sequence< sal_Int32 } return aSeq; } -Sequence< sal_uInt32 > SAL_CALL OComponent::methodULong(const Sequence< sal_uInt32 >& aSeq) throw( RuntimeException) +Sequence< sal_uInt32 > SAL_CALL OComponent::methodULong(const Sequence< sal_uInt32 >& aSeq) throw( RuntimeException) { sal_uInt32 _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ @@ -489,7 +489,7 @@ Sequence< sal_uInt32 > SAL_CALL OComponent::methodULong(const Sequence< sal_uInt } return aSeq; } -Sequence< OUString > SAL_CALL OComponent::methodString(const Sequence< OUString >& aSeq) throw( RuntimeException) +Sequence< OUString > SAL_CALL OComponent::methodString(const Sequence< OUString >& aSeq) throw( RuntimeException) { OUString _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++) { @@ -497,7 +497,7 @@ Sequence< OUString > SAL_CALL OComponent::methodString(const Sequence< OUString } return aSeq; } -Sequence< sal_Unicode > SAL_CALL OComponent::methodChar(const Sequence< sal_Unicode >& aSeq) throw( RuntimeException) +Sequence< sal_Unicode > SAL_CALL OComponent::methodChar(const Sequence< sal_Unicode >& aSeq) throw( RuntimeException) { sal_Unicode _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ @@ -505,7 +505,7 @@ Sequence< sal_Unicode > SAL_CALL OComponent::methodChar(const Sequence< sal_Unic } return aSeq; } -Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) throw( RuntimeException) +Sequence< Any > SAL_CALL OComponent::methodAny(const Sequence< Any >& aSeq) throw( RuntimeException) { Any _x; for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ @@ -527,7 +527,7 @@ Sequence< Type > SAL_CALL OComponent::methodType(const Sequence< Type >& aSeq) t return aSeq; } //Sequence< Reference< XInterface> > SAL_CALL methodXInterface ( const Sequence< Reference < XInterface> >& aSeq) -// throw (RuntimeException) +// throw (RuntimeException) Sequence< Reference< XInterface > > SAL_CALL OComponent::methodXInterface( const Sequence< Reference< XInterface > >& aSeq ) throw(RuntimeException) { for( sal_Int32 i= 0; i < aSeq.getLength(); i++) @@ -540,7 +540,7 @@ Sequence< Reference< XInterface > > SAL_CALL OComponent::methodXInterface( const return aSeq; } -Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::methodSequence(const Sequence< Sequence< sal_Int32 > >& aSeq) throw( RuntimeException) +Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::methodSequence(const Sequence< Sequence< sal_Int32 > >& aSeq) throw( RuntimeException) { sal_Int32 value; for( sal_Int16 i= 0; i < aSeq.getLength(); i++){ @@ -551,7 +551,7 @@ Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::methodSequence(const Sequ } return aSeq; } -Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL OComponent::methodSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq) +Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL OComponent::methodSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq) throw( RuntimeException ) { sal_Int32 value; @@ -577,10 +577,10 @@ Sequence< Reference< XEventListener> > SAL_CALL OComponent::methodXEventListener for( int i= 0; i < aSeq.getLength(); i++) { listener= aSeq[i]; - + listener->disposing( EventObject() ); } - + return aSeq; } @@ -589,7 +589,7 @@ Sequence< Sequence<Reference<XEventListener > > > SAL_CALL OComponent::methodXEv Reference<XEventListener> listener; for( int i= 0; i < aSeq.getLength(); i++) { - Sequence<Reference<XEventListener> > seqInner= aSeq[i]; + Sequence<Reference<XEventListener> > seqInner= aSeq[i]; for( int j= 0; j < seqInner.getLength(); j++) { listener= seqInner[j]; @@ -601,7 +601,7 @@ Sequence< Sequence<Reference<XEventListener > > > SAL_CALL OComponent::methodXEv //--------------------------------------------------------------------------------------------- -Sequence< sal_Int8 > SAL_CALL OComponent::getAttrByte(void) throw( RuntimeException) +Sequence< sal_Int8 > SAL_CALL OComponent::getAttrByte(void) throw( RuntimeException) { return m_seqByte; } @@ -627,8 +627,8 @@ void SAL_CALL OComponent::setAttrDouble(const Sequence< double >& AttrDouble_) t m_seqDouble= AttrDouble_; } -Sequence< sal_Bool > SAL_CALL OComponent::getAttrBool(void) throw( RuntimeException) -{ +Sequence< sal_Bool > SAL_CALL OComponent::getAttrBool(void) throw( RuntimeException) +{ return m_seqBool; } @@ -637,7 +637,7 @@ void SAL_CALL OComponent::setAttrBool(const Sequence< sal_Bool >& AttrBool_) thr m_seqBool= AttrBool_; } -Sequence< sal_Int16 > SAL_CALL OComponent::getAttrShort(void) throw( RuntimeException) +Sequence< sal_Int16 > SAL_CALL OComponent::getAttrShort(void) throw( RuntimeException) { return m_seqShort; } @@ -655,7 +655,7 @@ void SAL_CALL OComponent::setAttrUShort(const Sequence< sal_uInt16 >& AttrUShort m_seqUShort= AttrUShort_; } -Sequence< sal_Int32 > SAL_CALL OComponent::getAttrLong(void) throw( RuntimeException) +Sequence< sal_Int32 > SAL_CALL OComponent::getAttrLong(void) throw( RuntimeException) { return m_seqLong; } @@ -686,12 +686,12 @@ Sequence< sal_Unicode > SAL_CALL OComponent::getAttrChar(void) throw( RuntimeEx { return m_seqChar; } -void SAL_CALL OComponent::setAttrChar(const Sequence< sal_Unicode >& AttrChar_) throw( RuntimeException) +void SAL_CALL OComponent::setAttrChar(const Sequence< sal_Unicode >& AttrChar_) throw( RuntimeException) { m_seqChar= AttrChar_; } -Sequence< Any > SAL_CALL OComponent::getAttrAny(void) throw( RuntimeException) +Sequence< Any > SAL_CALL OComponent::getAttrAny(void) throw( RuntimeException) { return m_seqAny; } @@ -711,7 +711,7 @@ void SAL_CALL OComponent::setAttrType( const Sequence< Type >& AttrType_) throw( } -Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::getAttrSequence(void) throw( RuntimeException) +Sequence< Sequence< sal_Int32 > > SAL_CALL OComponent::getAttrSequence(void) throw( RuntimeException) { return m_seq1; } @@ -735,7 +735,7 @@ Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL OComponent::getAttrSequen { return m_seq2; } -void SAL_CALL OComponent::setAttrSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& AttrSequence2_) +void SAL_CALL OComponent::setAttrSequence2(const Sequence< Sequence< Sequence< sal_Int32 > > >& AttrSequence2_) throw( RuntimeException ) { m_seq2= AttrSequence2_; @@ -771,7 +771,7 @@ void SAL_CALL OComponent::setAFloat( float _afloat ) throw (RuntimeException) { m_attr_float = _afloat; } - + double SAL_CALL OComponent::getADouble() throw (RuntimeException) { return m_attr_double; @@ -943,7 +943,7 @@ void SAL_CALL OComponent::testout_methodChar(sal_Unicode& rOut) throw( RuntimeEx { rOut= m_char; } -void SAL_CALL OComponent::testout_methodAny(Any& rOut) throw( RuntimeException) +void SAL_CALL OComponent::testout_methodAny(Any& rOut) throw( RuntimeException) { rOut = m_any; } @@ -953,7 +953,7 @@ void SAL_CALL OComponent::testout_methodType(Type& rOut) throw( RuntimeException rOut = m_type; } -void SAL_CALL OComponent::testout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException) +void SAL_CALL OComponent::testout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException) { rOut.realloc(10); for( sal_Int16 i= 0; i < rOut.getLength(); i++) rOut.getArray()[i]= i; @@ -993,9 +993,9 @@ void SAL_CALL OComponent::testout_methodMulParams4( float in1, float& out1, sal_ void SAL_CALL OComponent::testout_methodXInterface( Reference< XInterface >& rOut ) throw(RuntimeException) { rOut = m_xinterface; -// OUString string( L"Property Any"); -// m_any <<= string; -// rOut= Reference<XInterface> (static_cast<XTestSequence*>(this), UNO_QUERY); +// OUString string( L"Property Any"); +// m_any <<= string; +// rOut= Reference<XInterface> (static_cast<XTestSequence*>(this), UNO_QUERY); } // XTestInParameters ------------------------------------------------------------ @@ -1023,7 +1023,7 @@ sal_Int16 SAL_CALL OComponent::in_methodShort( sal_Int16 rIn ) throw (RuntimeExc { m_int16 = rIn; return rIn; -} +} sal_uInt16 SAL_CALL OComponent::in_methodUShort( sal_uInt16 rIn ) throw (RuntimeException) { m_uint16 = rIn; @@ -1187,19 +1187,19 @@ void SAL_CALL OComponent::testinout_methodString(OUString& rOut) throw( RuntimeE rOut = m_string; m_string = tmp; } -void SAL_CALL OComponent::testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException) +void SAL_CALL OComponent::testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException) { sal_Unicode tmp = rOut; rOut = m_char; m_char = tmp; } -void SAL_CALL OComponent::testinout_methodAny(Any& rOut) throw( RuntimeException) +void SAL_CALL OComponent::testinout_methodAny(Any& rOut) throw( RuntimeException) { Any tmp = rOut; rOut = m_any; m_any = tmp; } -void SAL_CALL OComponent::testinout_methodType(Type& rOut) throw( RuntimeException) +void SAL_CALL OComponent::testinout_methodType(Type& rOut) throw( RuntimeException) { Type tmp = rOut; rOut = m_type; @@ -1207,9 +1207,9 @@ void SAL_CALL OComponent::testinout_methodType(Type& rOut) throw( RuntimeExcepti } -void SAL_CALL OComponent::testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException) +void SAL_CALL OComponent::testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException) { - + sal_Int32* arr= rOut.getArray(); for ( sal_Int32 i=0; i < rOut.getLength(); i++) { @@ -1250,27 +1250,27 @@ void SAL_CALL OComponent::testinout_methodXInterface2( Reference< XInterface > & Reference<XInterface> tmp = rOut; rOut = m_xinterface; m_xinterface = tmp; -// Reference<XTestSequence> xTest( rOut, UNO_QUERY); -// if( xTest.is()) -// { -// Any any= xTest->getAttrAny2(); -// OUString _s; -// any >>= _s; -// OUString string= _s + OUString((L" this string was written in the UNO component to the inout pararmeter")); -// any <<= string; -// xTest->setAttrAny2( any); -// } - -} -Any SAL_CALL OComponent::methodAnyTest1(const Any& rIn) throw( RuntimeException ) +// Reference<XTestSequence> xTest( rOut, UNO_QUERY); +// if( xTest.is()) +// { +// Any any= xTest->getAttrAny2(); +// OUString _s; +// any >>= _s; +// OUString string= _s + OUString((L" this string was written in the UNO component to the inout pararmeter")); +// any <<= string; +// xTest->setAttrAny2( any); +// } + +} +Any SAL_CALL OComponent::methodAnyTest1(const Any& rIn) throw( RuntimeException ) { return rIn; } -Any SAL_CALL OComponent::getAttrAny2(void) throw( RuntimeException ) +Any SAL_CALL OComponent::getAttrAny2(void) throw( RuntimeException ) { return m_any; } -void SAL_CALL OComponent::setAttrAny2(const Any& AttrAny2_) throw( RuntimeException ) +void SAL_CALL OComponent::setAttrAny2(const Any& AttrAny2_) throw( RuntimeException ) { m_any= AttrAny2_; } @@ -1297,7 +1297,7 @@ Property SAL_CALL OComponent::retMethodStruct(void) throw( RuntimeException ) return a; } -Property SAL_CALL OComponent::getAttrStruct(void) throw( RuntimeException) +Property SAL_CALL OComponent::getAttrStruct(void) throw( RuntimeException) { Property a(L"OleTest_Property", 255, getCppuType( (Reference<XInterface>*)0), PropertyAttribute::MAYBEVOID | PropertyAttribute::BOUND | PropertyAttribute::CONSTRAINED | @@ -1313,7 +1313,7 @@ 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) @@ -1347,7 +1347,7 @@ Any SAL_CALL OComponent::other_methodAny( const Any& rAny, const OUString& typeI throw (RuntimeException) { Type expectedType; - typelib_TypeDescription * pDesc= NULL; + typelib_TypeDescription * pDesc= NULL; typelib_typedescription_getByName( &pDesc, typeInAny.pData ); if( pDesc) { @@ -1356,96 +1356,96 @@ Any SAL_CALL OComponent::other_methodAny( const Any& rAny, const OUString& typeI } if (rAny.getValueType() != expectedType) throw RuntimeException(); - + return rAny; } // XTestOutParameters ============================================================================ -// void SAL_CALL OComponent::out_test(sal_Int8 rIn) throw( RuntimeException ) +// void SAL_CALL OComponent::out_test(sal_Int8 rIn) throw( RuntimeException ) // { // } // void SAL_CALL OComponent::out_methodByte(sal_Int8& rOut) throw( RuntimeException ) // { -// rOut= 100; +// rOut= 100; // } // void SAL_CALL OComponent::out_methodDouble(double& rOut) throw( RuntimeException ) // { -// rOut= 3.14; +// rOut= 3.14; // } // void SAL_CALL OComponent::out_methodFloat(float& rOut) throw( RuntimeException ) // { -// rOut= 3.14; +// rOut= 3.14; // } -// void SAL_CALL OComponent::out_methodBool(sal_Bool& rOut) throw( RuntimeException ) +// void SAL_CALL OComponent::out_methodBool(sal_Bool& rOut) throw( RuntimeException ) // { -// rOut= sal_True; +// rOut= sal_True; // } -// void SAL_CALL OComponent::out_methodShort(sal_Int16& rOut) throw( RuntimeException ) +// void SAL_CALL OComponent::out_methodShort(sal_Int16& rOut) throw( RuntimeException ) // { -// rOut= -100; +// rOut= -100; // } -// void SAL_CALL OComponent::out_methodUShort(sal_uInt16& rOut) throw( RuntimeException ) +// void SAL_CALL OComponent::out_methodUShort(sal_uInt16& rOut) throw( RuntimeException ) // { -// rOut= 100; +// rOut= 100; // } -// void SAL_CALL OComponent::out_methodLong(sal_Int32& rOut) throw( RuntimeException ) +// void SAL_CALL OComponent::out_methodLong(sal_Int32& rOut) throw( RuntimeException ) // { -// rOut= -100; +// rOut= -100; // } // void SAL_CALL OComponent::out_methodULong(sal_uInt32& rOut) throw( RuntimeException ) // { -// rOut= 100; +// rOut= 100; // } // void SAL_CALL OComponent::out_methodHyper(sal_Int64& rOut) throw( RuntimeException ) // { - + // } // void SAL_CALL OComponent::out_methodUHyper(sal_uInt64& rOut) throw( RuntimeException ) // { // } -// void SAL_CALL OComponent::out_methodString(OUString& rOut) throw( RuntimeException ) +// void SAL_CALL OComponent::out_methodString(OUString& rOut) throw( RuntimeException ) // { -// rOut= L"I'm a string"; +// rOut= L"I'm a string"; // } -// void SAL_CALL OComponent::out_methodChar(sal_Unicode& rOut) throw( RuntimeException ) +// void SAL_CALL OComponent::out_methodChar(sal_Unicode& rOut) throw( RuntimeException ) // { -// rOut= 'A'; +// rOut= 'A'; // } // void SAL_CALL OComponent::out_methodAny(Any& rOut) throw( RuntimeException) // { -// Any a; +// Any a; // a <<= OUString( L"Hi"); -// rOut= a; +// rOut= a; // } // void SAL_CALL OComponent::out_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException ) // { -// Sequence< sal_Int32 > aseq(10); -// for( sal_Int16 i= 0; i < aseq.getLength(); i++) aseq.getArray()[i]= i; -// rOut= aseq; +// Sequence< sal_Int32 > aseq(10); +// for( sal_Int16 i= 0; i < aseq.getLength(); i++) aseq.getArray()[i]= i; +// rOut= aseq; // } // void SAL_CALL OComponent::out_methodSequence2(Sequence< Sequence< sal_Int32 > >& rOut) throw( RuntimeException ) // { -// rOut= Sequence< Sequence< sal_Int32 > >(); +// rOut= Sequence< Sequence< sal_Int32 > >(); // } // void SAL_CALL OComponent::out_methodMulParams1(sal_Int32& rout1, sal_Int32& rout2) throw( RuntimeException ) // { -// rout1= 111; -// rout2= 222; +// rout1= 111; +// rout2= 222; // } // void SAL_CALL OComponent::out_methodMulParams2(sal_Int32& rout1, sal_Int32& rout2, OUString& rout3) throw( RuntimeException ) // { -// rout1= 111; -// rout2= 222; -// rout3= L"this is a neet little string"; +// rout1= 111; +// rout2= 222; +// rout3= L"this is a neet little string"; // } // void SAL_CALL OComponent::out_methodMulParams3(const OUString& sin, OUString& sout) throw( RuntimeException ) // { -// sout= L"this is a neet little string"; +// sout= L"this is a neet little string"; // } // XTestInterfaces ------------------------------------------------------------------------------------- @@ -1469,15 +1469,15 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac sal_Int8 aByte; sal_Int16 aShort; sal_Int32 aLong; -// sal_uInt16 aUShort; -// sal_uInt32 aULong; +// sal_uInt16 aUShort; +// sal_uInt32 aULong; switch( mode) { case 1: xCallback->func1(); break; case 2: - xSimple= xCallback->returnInterface(); + xSimple= xCallback->returnInterface(); xSimple->func(L"XCallback::returnInterface"); break; @@ -1579,23 +1579,23 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac SimpleStruct aSimpleStruct; SimpleEnum aSimpleEnum; Sequence<Any> seqAny; - Any aAny; - sal_Bool aBool; + Any aAny; + sal_Bool aBool; sal_Unicode aChar; - OUString aString; - float aFloat; - double aDouble; - sal_Int8 aByte; - sal_Int16 aShort; - sal_Int32 aLong; -// sal_uInt16 aUShort; -// sal_uInt32 aULong; + OUString aString; + float aFloat; + double aDouble; + sal_Int8 aByte; + sal_Int16 aShort; + sal_Int32 aLong; +// sal_uInt16 aUShort; +// sal_uInt32 aULong; xCallback->outValuesAll( xSimple, aSimpleStruct, aSimpleEnum, seqAny, aAny, aBool, aChar, aString, aFloat, aDouble, aByte, aShort, aLong); - + MessageBox( NULL, _T("XCallback::outValuesAll returned"), _T("OleTest::testInterface"), MB_OK); break; } @@ -1647,7 +1647,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac // a Struct should now contain a different message MessageBox( NULL, W2T(aStruct.message), _T("OleTest in out parameter"), MB_OK); } - + } break; } @@ -1684,7 +1684,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac } } - + break; } case 104: @@ -1815,10 +1815,10 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac sal_Int16 aShort= 0xff; sal_Int32 aLong= 0xffe; - xCallback->inoutValuesAll( aXSimple, aStruct, aEnum, aSeq, - aAny, aBool, aChar, aString, aFloat, aDouble, + xCallback->inoutValuesAll( aXSimple, aStruct, aEnum, aSeq, + aAny, aBool, aChar, aString, aFloat, aDouble, aByte, aShort, aLong ); - + aXSimple->func(L"XSimple called from OleTest"); MessageBox( NULL, W2T(aStruct.message), _T("OleTest"), MB_OK); @@ -1856,7 +1856,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac const int LISTENERS= 3; Reference<XEventListener> arListeners[LISTENERS]; EventObject arEvents[LISTENERS]; - + for( int i= 0; i < LISTENERS; i++) { Reference<XInterface> aList= static_cast<XWeak*>( new EventListener()); @@ -1867,7 +1867,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac Sequence<EventObject>(arEvents, LISTENERS)); break; } - + // ############################################################################ // Call a COM object that has not been passed as parameter to a UNO component and // hence no type information are available in the COM wrapper @@ -1875,30 +1875,30 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac case 300: { Reference<XInterface> xIntFact = m_rFactory->createInstance(L"com.sun.star.bridge.oleautomation.Factory"); - + Reference<XMultiServiceFactory> oleFact(xIntFact, UNO_QUERY); Reference<XInterface> xIntCallback= oleFact->createInstance(L"XCallback_Impl.Callback"); Reference<XInvocation> xInv( xIntCallback, UNO_QUERY); //Any SAL_CALL invoke( const OUString& aFunctionName, const Sequence<Any >& aParams,Sequence< sal_Int16 >& aOutParamIndex, -// Sequence<Any >& aOutParam ); +// Sequence<Any >& aOutParam ); Sequence<sal_Int16> seqIndizes; Sequence<Any> seqOutParams; xInv->invoke( OUString( L"outValuesAll"), Sequence<Any>(), seqIndizes, seqOutParams); -// void outValuesAll( [out] oletest::XSimple outInterface, -// [out] SimpleStruct outStruct , -// [out] SimpleEnum outEnum, -// [out] sequence<any> outSeqAny, -// [out] any outAny, -// [out] boolean outBool, -// [out] char outChar, -// [out] string outString, -// [out] float outFloat, -// [out] double outDouble, -// [out] byte outByte, -// [out] short outShort, -// [out] long outLong); +// void outValuesAll( [out] oletest::XSimple outInterface, +// [out] SimpleStruct outStruct , +// [out] SimpleEnum outEnum, +// [out] sequence<any> outSeqAny, +// [out] any outAny, +// [out] boolean outBool, +// [out] char outChar, +// [out] string outString, +// [out] float outFloat, +// [out] double outDouble, +// [out] byte outByte, +// [out] short outShort, +// [out] long outLong); if( seqOutParams.getLength() == 12) { Reference<XSimple> xSimple= *(XSimple**)seqOutParams[0].getValue(); @@ -1914,7 +1914,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac OUString _s; seqAny[i] >>= _s; } - + Any _any= *(Any*)seqOutParams[4].getValue(); sal_Bool _bool= *(sal_Bool*)seqOutParams[5].getValue(); sal_Unicode _char= *( sal_Unicode*) seqOutParams[6].getValue(); @@ -1934,7 +1934,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac // in / out parameter { Reference<XInterface> xIntFact = m_rFactory->createInstance(L"com.sun.star.bridge.oleautomation.Factory"); - + Reference<XMultiServiceFactory> oleFact(xIntFact, UNO_QUERY); Reference<XInterface> xIntCallback= oleFact->createInstance(L"XCallback_Impl.Callback"); @@ -1970,7 +1970,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac arSeqAny[0] <<= OUString( L"string 0"); arSeqAny[1] <<= OUString( L"string 1"); arSeqAny[2] <<= OUString( L"string 2"); - + arAny[3] <<= Sequence< Any >( arAny, 3); OUString str(L" Ein Any param"); @@ -1989,9 +1989,9 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac arAny[11] <<= _short; sal_Int32 _long= -1; arAny[12] <<= _long; -// +// Sequence<Any> params( arAny, 13); - + xInv->invoke( OUString( L"inoutValuesAll"), params, seqIndizes, seqOutParams); if( seqOutParams.getLength() == 12) @@ -2009,7 +2009,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac OUString _s; seqAny[i] >>= _s; } - + Any _any= *(Any*)seqOutParams[4].getValue(); sal_Bool _bool= *(sal_Bool*)seqOutParams[5].getValue(); sal_Unicode _char= *( sal_Unicode*) seqOutParams[6].getValue(); @@ -2027,11 +2027,11 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac } case 303: // in parameter -// void inValues( [in] char aChar, [in] long aLong, [in] string aString); +// void inValues( [in] char aChar, [in] long aLong, [in] string aString); { Reference<XInterface> xIntFact = m_rFactory->createInstance( L"com.sun.star.bridge.oleautomation.Factory"); - + Reference<XMultiServiceFactory> oleFact(xIntFact, UNO_QUERY); Reference<XInterface> xIntCallback= oleFact->createInstance(L"XCallback_Impl.Callback"); @@ -2056,7 +2056,7 @@ void SAL_CALL OComponent::testInterface( const Reference< XCallback >& xCallbac // ############################################################################ case 400: - Reference<XSimple> simple= xCallback->getsimple(); + Reference<XSimple> simple= xCallback->getsimple(); simple->func(L"OleTest calls on XSimple"); break; diff --git a/extensions/test/ole/cppToUno/testcppuno.cxx b/extensions/test/ole/cppToUno/testcppuno.cxx index 6c4745a0f5cd..d1606c343d73 100644 --- a/extensions/test/ole/cppToUno/testcppuno.cxx +++ b/extensions/test/ole/cppToUno/testcppuno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -70,14 +70,14 @@ int __cdecl _tmain( int /*argc*/, _TCHAR * /*argv[]*/ ) return -1; } - + if( FAILED(hr=doTest())) { _com_error err( hr); const TCHAR * errMsg= err.ErrorMessage(); MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR); } - + CoUninitialize(); return 0; } @@ -104,11 +104,11 @@ HRESULT doTest() // disp contains now oletest.OleTest - // one dimensional array + // one dimensional array par= SafeArrayCreateVector( VT_UI1, 0, 5); unsigned char arbyte[]= { 1,2,3,4,5}; for(long i= 0; i < 5;i++) - hr= SafeArrayPutElement( par, &i, &arbyte[i]); + hr= SafeArrayPutElement( par, &i, &arbyte[i]); result.Clear(); param1.vt= VT_ARRAY| VT_UI1; @@ -131,7 +131,7 @@ HRESULT doTest() long uBound2; hr= SafeArrayGetUBound( par, 1, &uBound1); hr= SafeArrayGetUBound( par, 2, &uBound2); - + long index2[2]; memset( index2, 0, 2 * sizeof( long) ); long dimLengths[]={3,2}; @@ -147,28 +147,28 @@ HRESULT doTest() long (*dataL)[2][3]; hr= SafeArrayAccessData( par, (void**)&pdata); dataL= (long(*)[2][3])pdata; - + for (long i= 0; i < 2; i ++) { for(long j= 0; j < 3; j++) data= (*dataL)[i][j]; } hr= SafeArrayUnaccessData(par); - + result.Clear(); param1.vt= VT_ARRAY | VT_I4; param1.byref= par; disp.Invoke1(L"methodSequence", ¶m1, &result); - + SAFEARRAY* arRet= result.parray; - + for(long i= 0; i < 2 ; i++) { CComVariant varx; varx.Clear(); hr= SafeArrayGetElement( arRet, &i, &varx); SAFEARRAY* ari= varx.parray; - + for( j= 0; j < 3; j++) { CComVariant varj; @@ -188,7 +188,7 @@ HRESULT doTest() // left index is least significant bool incrementMultidimensionalIndex( sal_Int32 dimensions, - const sal_Int32 * parDimensionLengths, + const sal_Int32 * parDimensionLengths, sal_Int32 * parMultidimensionalIndex) { if( dimensions < 1) @@ -196,7 +196,7 @@ bool incrementMultidimensionalIndex( bool ret= sal_True; bool carry= sal_True; // to get into the while loop - + sal_Int32 currentDimension= 0; //most significant is 1 while( carry) { diff --git a/extensions/test/ole/cpptest/cpptest.cxx b/extensions/test/ole/cpptest/cpptest.cxx index ef6f44e5d1c7..9582415dfdfe 100644 --- a/extensions/test/ole/cpptest/cpptest.cxx +++ b/extensions/test/ole/cpptest/cpptest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ int main(int /*argc*/, char** /*argv*/) const TCHAR * errMsg= err.ErrorMessage(); MessageBox( NULL, errMsg, "Test failed", MB_ICONERROR); } - + CoUninitialize(); return 0; } @@ -82,7 +82,7 @@ HRESULT doTest() _variant_t varP1(L"com.sun.star.frame.Desktop"); _variant_t varRet; CComDispatchDriver dispMgr(starManager); - if (FAILED(hr= dispMgr.Invoke1(L"createInstance", &varP1, &varRet))) + if (FAILED(hr= dispMgr.Invoke1(L"createInstance", &varP1, &varRet))) { fprintf(stderr,"createInstance of Desktop failed\n"); return hr; @@ -110,7 +110,7 @@ HRESULT doTest() CComDispatchDriver dispDoc(varRet.pdispVal); varRet.Clear(); return S_OK; - + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/idl/oletest.idl b/extensions/test/ole/idl/oletest.idl index 61d668dc0580..c62c236de052 100644 --- a/extensions/test/ole/idl/oletest.idl +++ b/extensions/test/ole/idl/oletest.idl @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,8 +46,8 @@ interface XTestSequence: com::sun::star::uno::XInterface sequence<unsigned long> methodULong( [in] sequence<unsigned long> aSeq); sequence<string> methodString( [in] sequence<string> aSeq); sequence<char> methodChar( [in] sequence<char> aSeq); - sequence<any> methodAny ( [in] sequence<any> aSeq); - sequence<type> methodType ( [in] sequence<type> aSeq); + sequence<any> methodAny ( [in] sequence<any> aSeq); + sequence<type> methodType ( [in] sequence<type> aSeq); 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); @@ -83,7 +83,7 @@ interface XTestSequence: com::sun::star::uno::XInterface [attribute] any AAny; [attribute] type AType; [attribute] com::sun::star::uno::XInterface AXInterface; - [attribute] com::sun::star::script::XInvocation AXInvocation; + [attribute] com::sun::star::script::XInvocation AXInvocation; void testout_methodByte( [out] byte rOut ); void testout_methodFloat( [out] float rOut); @@ -97,8 +97,8 @@ interface XTestSequence: com::sun::star::uno::XInterface void testout_methodUHyper( [out] unsigned hyper rOut); void testout_methodString( [out] string rOut); void testout_methodChar( [out] char rOut); - void testout_methodAny ( [out] any rOut); - void testout_methodType ( [out] type rOut); + void testout_methodAny ( [out] any rOut); + void testout_methodType ( [out] type rOut); void testout_methodSequence( [out] sequence< long > rOut); void testout_methodSequence2( [out] sequence < sequence< long > > rOut); void testout_methodXInterface( [out] com::sun::star::uno::XInterface rOut); @@ -120,8 +120,8 @@ interface XTestSequence: com::sun::star::uno::XInterface void testinout_methodUHyper( [inout] unsigned hyper rOut); void testinout_methodString( [inout] string rOut); void testinout_methodChar( [inout] char rOut); - void testinout_methodAny ( [inout] any rOut); - void testinout_methodType ( [inout] type rOut); + void testinout_methodAny ( [inout] any rOut); + void testinout_methodType ( [inout] type rOut); void testinout_methodSequence( [inout] sequence< long > rOut); void testinout_methodSequence2( [inout] sequence < sequence< long > > rOut); void testinout_methodXInterface( [inout] com::sun::star::script::XInvocation rOut); @@ -135,7 +135,7 @@ interface XTestStruct: com::sun::star::uno::XInterface { // Method taking structs as arguments void methodStruct( [in] com::sun::star::beans::Property aProp); -// Methods returning structs +// Methods returning structs com::sun::star::beans::Property retMethodStruct(); // Attributes as structs [attribute] com::sun::star::beans::Property AttrStruct; @@ -163,8 +163,8 @@ interface XTestInParameters: com::sun::star::uno::XInterface unsigned hyper in_methodUHyper( [in] unsigned hyper rIn); string in_methodString( [in] string rIn); char in_methodChar( [in] char rIn); - any in_methodAny ( [in] any rIn); - type in_methodType ( [in] type rIn); + any in_methodAny ( [in] any rIn); + type in_methodType ( [in] type rIn); com::sun::star::uno::XInterface in_methodXInterface([in] com::sun::star::uno::XInterface rIn); com::sun::star::script::XInvocation in_methodInvocation( [in] com::sun::star::script::XInvocation inv); SimpleStruct in_methodStruct( [in] SimpleStruct aStruct); @@ -242,7 +242,7 @@ interface XCallback: com::sun::star::uno::XInterface [out] string outString, [out] float outFloat, [out] double outDouble, - [out] byte outByte, + [out] byte outByte, [out] short outShort, [out] long outLong); // IN OUT parameters @@ -280,7 +280,7 @@ interface XCallback: com::sun::star::uno::XInterface void inSeqByte( [in] sequence<byte> val); void inSeqXEventListener( [in] sequence<com::sun::star::lang::XEventListener> listener, [in] sequence<com::sun::star::lang::EventObject> events); - + // Attributes [attribute] oletest::XSimple simple; diff --git a/extensions/test/ole/unloading/unloadTest.cxx b/extensions/test/ole/unloading/unloadTest.cxx index 85f2de33db47..ccedf0bd2f74 100644 --- a/extensions/test/ole/unloading/unloadTest.cxx +++ b/extensions/test/ole/unloading/unloadTest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -89,7 +89,7 @@ sal_Bool test1() osl_unloadModule( hMod); rtl_unloadUnusedModules( NULL); - + OUString sFactoryFunc( RTL_CONSTASCII_USTRINGPARAM("component_getFactory")); void* pSymbol= osl_getSymbol( hMod,sFactoryFunc.pData); // true, instance alive @@ -145,7 +145,7 @@ sal_Bool test3() Reference<XSimpleRegistry> xreg= createSimpleRegistry(); xreg->open( OUString( RTL_CONSTASCII_USTRINGPARAM("services.rdb")), sal_False, sal_False ); - + Reference< XComponentContext > context= bootstrap_InitialComponentContext(xreg); Reference<XMultiComponentFactory> fac= context->getServiceManager(); @@ -172,18 +172,18 @@ sal_Bool test3() Reference<XComponent> xcomp( context, UNO_QUERY); xcomp->dispose(); -// for (int i=0; i < 10; i++) -// { -// Reference<XSimpleRegistry> xreg= createSimpleRegistry(); -// xreg->open( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")), -// sal_False, sal_False ); -// Reference< XComponentContext > context= bootstrap_InitialComponentContext(xreg); -// Reference<XComponent> xcomp( context, UNO_QUERY); -// xcomp->dispose(); +// for (int i=0; i < 10; i++) +// { +// Reference<XSimpleRegistry> xreg= createSimpleRegistry(); +// xreg->open( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")), +// sal_False, sal_False ); +// Reference< XComponentContext > context= bootstrap_InitialComponentContext(xreg); +// Reference<XComponent> xcomp( context, UNO_QUERY); +// xcomp->dispose(); // -// } +// } -// return sal_True; +// return sal_True; return bTest1 && bTest2; } @@ -217,7 +217,7 @@ sal_Bool test4() // ApplicationRegistration is a one-instance-service, therefore kill service manager first Reference<XComponent> xcomp( context, UNO_QUERY); xcomp->dispose(); - + } rtl_unloadUnusedModules( NULL); pSymbol= osl_getSymbol( hMod,sFactoryFunc.pData); diff --git a/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp b/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp index a5d05fe90aa9..36ed10eddb1a 100644 --- a/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp +++ b/extensions/test/ole/unoTocomCalls/Test/StdAfx.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -26,8 +26,8 @@ * ************************************************************************/ // stdafx.cpp : source file that includes just the standard includes -// Test.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information +// Test.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information #include "stdafx.h" diff --git a/extensions/test/ole/unoTocomCalls/Test/StdAfx.h b/extensions/test/ole/unoTocomCalls/Test/StdAfx.h index 408c5cd1fa87..65fffc04cffe 100644 --- a/extensions/test/ole/unoTocomCalls/Test/StdAfx.h +++ b/extensions/test/ole/unoTocomCalls/Test/StdAfx.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ #pragma once #endif // _MSC_VER > 1000 -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <stdio.h> #include <windows.h> diff --git a/extensions/test/ole/unoTocomCalls/Test/Test.cpp b/extensions/test/ole/unoTocomCalls/Test/Test.cpp index 27a2229a4d5d..fcb121be6b2a 100644 --- a/extensions/test/ole/unoTocomCalls/Test/Test.cpp +++ b/extensions/test/ole/unoTocomCalls/Test/Test.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) return -1; } - + _Module.Init( ObjectMap, GetModuleHandle( NULL)); if( FAILED(hr=doTest())) @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) _Module.Term(); CoUninitialize(); - + return 0; } @@ -78,7 +78,7 @@ HRESULT doTest() CComDispatchDriver manager( spUnk); CComVariant param( L"oletest.OleTest"); CComVariant retVal; - hr= manager.Invoke1((LPCOLESTR)L"createInstance", ¶m, &retVal ); + hr= manager.Invoke1((LPCOLESTR)L"createInstance", ¶m, &retVal ); CComDispatchDriver oletest( retVal.punkVal); @@ -92,7 +92,7 @@ HRESULT doTest() //###################################################################### - // out parameters + // out parameters //###################################################################### CComVariant param1( paramDisp); CComVariant param2(1); @@ -149,13 +149,13 @@ HRESULT doTest() hr= oletest.Invoke2(L"testInterface", ¶m1, ¶m2); // XCallback::outSeqByte - // Does not work currently because Sequences are always converted to + // Does not work currently because Sequences are always converted to // SAFEARRAY( VARIANT) - // param2= 32; - // hr= oletest.Invoke2(L"testInterface", ¶m1, ¶m2); - + // param2= 32; + // hr= oletest.Invoke2(L"testInterface", ¶m1, ¶m2); + //###################################################################### - // in / out parameters + // in / out parameters //###################################################################### // XCallback::inoutInterface param2= 100; @@ -200,7 +200,7 @@ HRESULT doTest() param2=120; hr= oletest.Invoke2(L"testInterface", ¶m1, ¶m2); //###################################################################### - // in parameters + // in parameters //###################################################################### // XCallback::inValues param2= 200; @@ -213,7 +213,7 @@ HRESULT doTest() param2= 202; hr= oletest.Invoke2(L"testInterface", ¶m1, ¶m2); //###################################################################### - // The UNO test component OleTest calls on XCallback_Impl.Callback directly + // The UNO test component OleTest calls on XCallback_Impl.Callback directly // that is the COM object has not been past a parameter but rather OleTest // creates the COM object itself //###################################################################### @@ -244,6 +244,6 @@ HRESULT doTest() return hr; } // VARIANT CComVariant VT_UNKNOWN VT_DISPATCH V_UI1 CComDispatchDriver WINAPI - + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp index b8e9847b18a7..ea21a969552e 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ STDMETHODIMP CCallback::func1() STDMETHODIMP CCallback::returnInterface(IDispatch **ppdisp) { if( ! ppdisp) - return E_POINTER; + return E_POINTER; CComPtr<IDispatch> spDisp; spDisp.CoCreateInstance( L"XCallback_Impl.Simple"); *ppdisp= spDisp; @@ -53,15 +53,15 @@ STDMETHODIMP CCallback::returnInterface(IDispatch **ppdisp) STDMETHODIMP CCallback::outInterface(IDispatch **ppdisp) { -// return S_OK; +// return S_OK; if( ! ppdisp) - return E_POINTER; + return E_POINTER; CComPtr<IDispatch> spDisp; spDisp.CoCreateInstance( L"XCallback_Impl.Simple"); *ppdisp= spDisp; (*ppdisp)->AddRef(); -// MessageBox( NULL, _T("CCallback::outInterface"), _T(""), MB_OK); +// MessageBox( NULL, _T("CCallback::outInterface"), _T(""), MB_OK); return S_OK; } @@ -76,7 +76,7 @@ STDMETHODIMP CCallback::outValuesMixed(long val, long *pval, BSTR string) } -STDMETHODIMP CCallback::outValuesAll( +STDMETHODIMP CCallback::outValuesAll( /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdisp, /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppSimpleStruct, /* [out] */ long __RPC_FAR *aSimpleEnum, @@ -92,11 +92,11 @@ STDMETHODIMP CCallback::outValuesAll( /* [out] */ long __RPC_FAR *aLong) //) { -// if( ! ppdisp || ! ppSimpleStruct || ! aSimpleEnum || -// ! outSeq || !varAny ||! aBool || ! aChar || -// ! aString || ! aFloat || ! aDouble || ! aByte || -// ! aShort || ! aLong || ! aUShort || ! aULong) -// return E_POINTER; +// if( ! ppdisp || ! ppSimpleStruct || ! aSimpleEnum || +// ! outSeq || !varAny ||! aBool || ! aChar || +// ! aString || ! aFloat || ! aDouble || ! aByte || +// ! aShort || ! aLong || ! aUShort || ! aULong) +// return E_POINTER; HRESULT hr=S_OK; hr= outInterface( ppdisp); @@ -117,11 +117,11 @@ STDMETHODIMP CCallback::outValuesAll( STDMETHODIMP CCallback::outStruct(IDispatch **outStruct) { -// return S_OK; +// return S_OK; if( !outStruct) return E_POINTER; HRESULT hr= E_FAIL; -// MessageBox( NULL, _T("CCallback::outStruct"), _T(""), MB_OK); +// MessageBox( NULL, _T("CCallback::outStruct"), _T(""), MB_OK); CComPtr<IDispatch> _dispMgr; if( SUCCEEDED(hr= _dispMgr.CoCreateInstance(L"com.sun.star.ServiceManager"))) @@ -130,14 +130,14 @@ STDMETHODIMP CCallback::outStruct(IDispatch **outStruct) CComVariant param1(L"com.sun.star.reflection.CoreReflection"); CComVariant varRet; hr= manager.Invoke1( L"createInstance", ¶m1, &varRet); - + CComDispatchDriver reflection( varRet.pdispVal); param1= L"oletest.SimpleStruct"; varRet.Clear(); hr= reflection.Invoke1( L"forName", ¶m1, &varRet); CComDispatchDriver classSimpleStruct( varRet.pdispVal); - + CComPtr<IDispatch> dispStruct; param1.vt= VT_DISPATCH | VT_BYREF; param1.ppdispVal= &dispStruct; @@ -146,7 +146,7 @@ STDMETHODIMP CCallback::outStruct(IDispatch **outStruct) // Set the value CComDispatchDriver simpleStruct( dispStruct); param1=L" this is a property string"; - hr= simpleStruct.PutPropertyByName(L"message", ¶m1); + hr= simpleStruct.PutPropertyByName(L"message", ¶m1); *outStruct= dispStruct; (*outStruct)->AddRef(); hr= S_OK; @@ -165,14 +165,14 @@ STDMETHODIMP CCallback::outEnum(long *outEnum) STDMETHODIMP CCallback::outSeqAny(LPSAFEARRAY* outSeq) { -// _CrtDbgBreak(); +// _CrtDbgBreak(); SAFEARRAY* pArr= SafeArrayCreateVector( VT_VARIANT, 0, 3); CComVariant var[3]; var[0]=L" variant 0"; var[1]=L" variant 1"; var[2]=L"variant 2"; for( long i=0; i<3; i++) - { + { SafeArrayPutElement( pArr, &i, (void*)&var[i]); } @@ -298,7 +298,7 @@ STDMETHODIMP CCallback::inoutStruct(IDispatch **inoutVal) hr= outStruct( &dispStruct.p); var.Clear(); var= L"This struct was created in XCallback_Imp.Callback"; - hr= dispStruct.PutPropertyByName(L"message", &var); + hr= dispStruct.PutPropertyByName(L"message", &var); *inoutVal= dispStruct; (*inoutVal)->AddRef(); @@ -332,7 +332,7 @@ STDMETHODIMP CCallback::inoutSeqAny(LPSAFEARRAY *pArray) var.Clear(); hr= SafeArrayGetElement( *pArray, &i, (void*)&var); } - + SafeArrayDestroy( *pArray); outSeqAny( pArray); @@ -368,7 +368,7 @@ STDMETHODIMP CCallback::inoutChar(short *inoutVal) return E_POINTER; USES_CONVERSION; char buff[256]; - sprintf( buff, "character value: %C", *inoutVal); + sprintf( buff, "character value: %C", *inoutVal); MessageBox( NULL, A2T(buff), _T("XCallback_Impl.Callback"), MB_OK); *inoutVal= L'B'; return S_OK; @@ -426,7 +426,7 @@ STDMETHODIMP CCallback::inoutLong(long* inoutVal) return S_OK; } -STDMETHODIMP CCallback::inoutValuesAll( +STDMETHODIMP CCallback::inoutValuesAll( /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aXSimple, /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aStruct, /* [out][in] */ long __RPC_FAR *aEnum, @@ -457,7 +457,7 @@ STDMETHODIMP CCallback::inoutValuesAll( return S_OK; } - + STDMETHODIMP CCallback::inValues(short aChar, long aLong, BSTR aString) { @@ -504,7 +504,7 @@ STDMETHODIMP CCallback::inSeqXEventListener( LPSAFEARRAY listeners, LPSAFEARRAY CComDispatchDriver disp( varListener.pdispVal); hr= disp.Invoke1(L"disposing", &varEvent); } - + } return S_OK; diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h index 645f62c18c93..02cb6cff483f 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Callback.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ ///////////////////////////////////////////////////////////////////////////// // CCallback -class ATL_NO_VTABLE CCallback : +class ATL_NO_VTABLE CCallback : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CCallback, &CLSID_Callback>, public IDispatchImpl<ICallback, &IID_ICallback, &LIBID_XCALLBACK_IMPLLib> @@ -72,7 +72,7 @@ public: STDMETHOD(inoutEnum)(/*[in,out]*/ long * inoutVal); STDMETHOD(inoutStruct)(/*[in,out]*/ IDispatch** inoutVal); STDMETHOD(inoutInterface)(/*[in,out]*/ IDispatch** ppdisp); - STDMETHOD(inoutValuesAll)( + STDMETHOD(inoutValuesAll)( /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aXSimple, /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *aStruct, /* [out][in] */ long __RPC_FAR *aEnum, @@ -86,7 +86,7 @@ public: /* [out][in] */ unsigned char __RPC_FAR *aByte, /* [out][in] */ short __RPC_FAR *aShort, /* [out][in] */ long __RPC_FAR *aLong); - + STDMETHOD(outByte)( unsigned char* outByte); STDMETHOD(outLong)(/*[out]*/ long* outLong); STDMETHOD(outShort)(/*[out]*/ short *outShort); @@ -99,7 +99,7 @@ public: STDMETHOD(outSeqAny)(/*[out]*/LPSAFEARRAY* outSeq); STDMETHOD(outEnum)(/*[out]*/ long* outEnum); STDMETHOD(outStruct)(/*[out]*/ IDispatch** outStruct); - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE outValuesAll( + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE outValuesAll( /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppdisp, /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppSimpleStruct, /* [out] */ long __RPC_FAR *aSimpleEnum, @@ -113,19 +113,19 @@ public: /* [out] */ unsigned char __RPC_FAR *aByte, /* [out] */ short __RPC_FAR *aShort, /* [out] */ long __RPC_FAR *aLong); -// ); +// ); // -// STDMETHOD(outValuesAll)( -// /*[out]*/ IDispatch** ppdisp, -// /*[out]*/ IUnknown** ppSimpleStruct, -// /*[out]*/ long* aSimpleEnum, -// /*[out]*/ VARIANT* ArrayAny, -// /*[out]*/ VARIANT* varAny, -// /*[out]*/ VARIANT_BOOL * aBool, -// /*[out]*/ unsigned short* aChar, -// /*[out]*/ BSTR* aString, /*[out]*/ float* aFloat, -// /*[out]*/ double* aDouble, -// /*[out]*/ signed char* aByte, /*[out]*/ short* aShort, /*[out]*/long* aLong, /*[out]*/ unsigned short* aUShort, /*[out]*/ unsigned long* aULong); +// STDMETHOD(outValuesAll)( +// /*[out]*/ IDispatch** ppdisp, +// /*[out]*/ IUnknown** ppSimpleStruct, +// /*[out]*/ long* aSimpleEnum, +// /*[out]*/ VARIANT* ArrayAny, +// /*[out]*/ VARIANT* varAny, +// /*[out]*/ VARIANT_BOOL * aBool, +// /*[out]*/ unsigned short* aChar, +// /*[out]*/ BSTR* aString, /*[out]*/ float* aFloat, +// /*[out]*/ double* aDouble, +// /*[out]*/ signed char* aByte, /*[out]*/ short* aShort, /*[out]*/long* aLong, /*[out]*/ unsigned short* aUShort, /*[out]*/ unsigned long* aULong); STDMETHOD(outValuesMixed)(/*[in]*/ long val, /*[out]*/ long* pval, /*[in]*/ BSTR string); STDMETHOD(outInterface)(/*[out]*/ IDispatch** ppdisp); STDMETHOD(returnInterface)(/*[out, retval]*/ IDispatch** ppdisp); @@ -133,6 +133,6 @@ public: }; #endif //__CALLBACK_H_ - + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp index e3a738960ee5..34a5075db803 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,9 +60,9 @@ STDMETHODIMP CSimple::func3(BSTR message) STDMETHODIMP CSimple::get__implementedInterfaces(LPSAFEARRAY *pVal) { HRESULT hr= S_OK; - SAFEARRAY *pArr= SafeArrayCreateVector( VT_BSTR, 0, 3); + SAFEARRAY *pArr= SafeArrayCreateVector( VT_BSTR, 0, 3); if( pArr) - { long index=0; + { long index=0; BSTR name1= SysAllocString(L"oletest.XSimple"); BSTR name2= SysAllocString(L"oletest.XSimple2"); BSTR name3= SysAllocString(L"oletest.XSimple3"); diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h index c911cb325240..e76795925573 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/Simple.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ ///////////////////////////////////////////////////////////////////////////// // CSimple -class ATL_NO_VTABLE CSimple : +class ATL_NO_VTABLE CSimple : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CSimple, &CLSID_Simple>, public IDispatchImpl<ISimple, &IID_ISimple, &LIBID_XCALLBACK_IMPLLib> @@ -55,8 +55,8 @@ END_COM_MAP() // ISimple public: - - STDMETHOD(get__implementedInterfaces)(/*[out, retval]*/ LPSAFEARRAY *pVal); + + STDMETHOD(get__implementedInterfaces)(/*[out, retval]*/ LPSAFEARRAY *pVal); STDMETHOD(func3)(/*[in]*/ BSTR message); STDMETHOD(func2)(/*[in]*/ BSTR message); STDMETHOD(func)( BSTR message); diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp index 38d4c2357e81..902524bdf104 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h index 0bb223891626..f692fae959e7 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/StdAfx.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp index eb5095730702..78585a01bc83 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.cpp @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -29,7 +29,7 @@ // Note: Proxy/Stub Information -// To build a separate proxy/stub DLL, +// To build a separate proxy/stub DLL, // run nmake -f XCallback_Implps.mk in the project directory. #include "stdafx.h" diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl index 2bb44a4b70be..5532432130c8 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/XCallback_Impl.idl @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,18 +45,18 @@ import "ocidl.idl"; [id(2), helpstring("method returnInterface")] HRESULT returnInterface([out, retval] IDispatch** ppdisp); [id(3), helpstring("method outInterface")] HRESULT outInterface([out] IDispatch** ppdisp); [id(4), helpstring("method outValuesMixed")] HRESULT outValuesMixed([in] long val, [out] long* pval, [in] BSTR string); - [id(5), helpstring("method outValuesAll")] HRESULT outValuesAll([out] IDispatch** ppdisp, [out] IDispatch** ppSimpleStruct, [out] long* aSimpleEnum, - [out] SAFEARRAY( VARIANT)* outSeq, - [out] VARIANT* varAny, + [id(5), helpstring("method outValuesAll")] HRESULT outValuesAll([out] IDispatch** ppdisp, [out] IDispatch** ppSimpleStruct, [out] long* aSimpleEnum, + [out] SAFEARRAY( VARIANT)* outSeq, + [out] VARIANT* varAny, [out] VARIANT_BOOL * aBool, [out] short* aChar, [out] BSTR* aString , - [out] float* aFloat, - [out] double* aDouble, + [out] float* aFloat, + [out] double* aDouble, [out] unsigned char* aByte, - [out] short* aShort, + [out] short* aShort, [out]long* aLong); -// ); +// ); [id(6), helpstring("method outStruct")] HRESULT outStruct([out] IDispatch** outStruct); [id(7), helpstring("method outEnum")] HRESULT outEnum([out] long* outEnum); [id(8), helpstring("method outSeqAny")] HRESULT outSeqAny([out] SAFEARRAY( VARIANT)* outSeq); diff --git a/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h b/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h index afdbe7bcd552..d041b3790555 100644 --- a/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h +++ b/extensions/test/ole/unoTocomCalls/XCallback_Impl/resource.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #define IDR_SIMPLESTRUCT 103 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 201 |