merge the formfield patch from ooo-build
[ooovba.git] / bridges / source / cpp_uno / gcc3_linux_powerpc64 / uno2cpp.cxx
blobd4f0dba4ce541f60d9ad8e1494d52d4d08c0ef17
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: uno2cpp.cxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_bridges.hxx"
34 #include <malloc.h>
36 #include <com/sun/star/uno/genfunc.hxx>
37 #include <uno/data.h>
39 #include "bridges/cpp_uno/shared/bridge.hxx"
40 #include "bridges/cpp_uno/shared/types.hxx"
41 #include "bridges/cpp_uno/shared/unointerfaceproxy.hxx"
42 #include "bridges/cpp_uno/shared/vtables.hxx"
44 #include "share.hxx"
46 #include <stdio.h>
47 #include <string.h>
50 using namespace ::rtl;
51 using namespace ::com::sun::star::uno;
53 void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn)
55 switch (eTypeClass)
57 case typelib_TypeClass_HYPER:
58 case typelib_TypeClass_UNSIGNED_HYPER:
59 *reinterpret_cast<sal_uInt64 *>( pRegisterReturn ) = r3;
60 break;
61 case typelib_TypeClass_LONG:
62 case typelib_TypeClass_UNSIGNED_LONG:
63 case typelib_TypeClass_ENUM:
64 *reinterpret_cast<sal_uInt32 *>( pRegisterReturn ) = r3;
65 break;
66 case typelib_TypeClass_CHAR:
67 case typelib_TypeClass_SHORT:
68 case typelib_TypeClass_UNSIGNED_SHORT:
69 *reinterpret_cast<sal_uInt16 *>( pRegisterReturn ) = (unsigned short)r3;
70 break;
71 case typelib_TypeClass_BOOLEAN:
72 case typelib_TypeClass_BYTE:
73 *reinterpret_cast<sal_uInt8 *>( pRegisterReturn ) = (unsigned char)r3;
74 break;
75 case typelib_TypeClass_FLOAT:
76 *reinterpret_cast<float *>( pRegisterReturn ) = dret;
77 break;
78 case typelib_TypeClass_DOUBLE:
79 *reinterpret_cast<double *>( pRegisterReturn ) = dret;
80 break;
81 default:
82 break;
86 namespace
88 //==================================================================================================
89 static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
90 void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr,
91 sal_uInt64 *pStack, sal_uInt32 nStack,
92 sal_uInt64 *pGPR, sal_uInt32 nGPR,
93 double *pFPR, sal_uInt32 nFPR)
95 // Stack, if used, must be 16-bytes aligned
96 if ( nStack )
97 nStack = ( nStack + 1 ) & ~1;
99 // Should not happen, but...
100 if ( nFPR > ppc64::MAX_SSE_REGS )
101 nFPR = ppc64::MAX_SSE_REGS;
102 if ( nGPR > ppc64::MAX_GPR_REGS )
103 nGPR = ppc64::MAX_GPR_REGS;
105 #ifdef CMC_DEBUG
106 // Let's figure out what is really going on here
108 fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR );
109 for ( int i = 0; i < nGPR; ++i )
110 fprintf( stderr, "0x%lx, ", pGPR[i] );
111 fprintf( stderr, "\nFPR's (%d): ", nFPR );
112 for ( int i = 0; i < nFPR; ++i )
113 fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] );
114 fprintf( stderr, "\nStack (%d): ", nStack );
115 for ( int i = 0; i < nStack; ++i )
116 fprintf( stderr, "0x%lx, ", pStack[i] );
117 fprintf( stderr, "\n" );
119 #endif
121 // Load parameters to stack, if necessary
122 sal_uInt64 *stack = (sal_uInt64 *) __builtin_alloca( nStack * 8 );
123 memcpy( stack, pStack, nStack * 8 );
125 // Get pointer to method
126 sal_uInt64 pMethod = *((sal_uInt64 *)pThis);
127 pMethod += 8 * nVtableIndex;
128 pMethod = *((sal_uInt64 *)pMethod);
130 typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 );
131 FunctionCall pFunc = (FunctionCall)pMethod;
133 volatile double dret;
135 // fill registers
136 __asm__ __volatile__ (
137 "ld 3, 0(%0)\n\t"
138 "ld 4, 8(%0)\n\t"
139 "ld 5, 16(%0)\n\t"
140 "ld 6, 24(%0)\n\t"
141 "ld 7, 32(%0)\n\t"
142 "ld 8, 40(%0)\n\t"
143 "ld 9, 48(%0)\n\t"
144 "ld 10, 56(%0)\n\t"
145 "lfd 1, 0(%1)\n\t"
146 "lfd 2, 8(%1)\n\t"
147 "lfd 3, 16(%1)\n\t"
148 "lfd 4, 24(%1)\n\t"
149 "lfd 5, 32(%1)\n\t"
150 "lfd 6, 40(%1)\n\t"
151 "lfd 7, 48(%1)\n\t"
152 "lfd 8, 56(%1)\n\t"
153 "lfd 9, 64(%1)\n\t"
154 "lfd 10, 72(%1)\n\t"
155 "lfd 11, 80(%1)\n\t"
156 "lfd 12, 88(%1)\n\t"
157 "lfd 13, 96(%1)\n\t"
158 : : "r" (pGPR), "r" (pFPR)
159 : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
160 "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9",
161 "fr10", "fr11", "fr12", "fr13"
164 // tell gcc that r3 to r11 are not available to it for doing the TOC and exception munge on the func call
165 register sal_uInt64 r3 asm("r3");
166 register sal_uInt64 r4 asm("r4");
167 register sal_uInt64 r5 asm("r5");
168 register sal_uInt64 r6 asm("r6");
169 register sal_uInt64 r7 asm("r7");
170 register sal_uInt64 r8 asm("r8");
171 register sal_uInt64 r9 asm("r9");
172 register sal_uInt64 r10 asm("r10");
173 register sal_uInt64 r11 asm("r11");
175 (*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10);
177 // get return value
178 __asm__ __volatile__ (
179 "mr %1, 3\n\t"
180 "mr %2, 4\n\t"
181 "fmr %0, 1\n\t"
182 : "=f" (dret), "=r" (r3), "=r" (r4) : );
184 MapReturn(r3, dret, pReturnTypeDescr->eTypeClass, pRegisterReturn);
187 // Macros for easier insertion of values to registers or stack
188 // pSV - pointer to the source
189 // nr - order of the value [will be increased if stored to register]
190 // pFPR, pGPR - pointer to the registers
191 // pDS - pointer to the stack [will be increased if stored here]
193 // The value in %xmm register is already prepared to be retrieved as a float,
194 // thus we treat float and double the same
195 #define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \
196 if ( nr < ppc64::MAX_SSE_REGS ) \
197 pFPR[nr++] = *reinterpret_cast<float *>( pSV ); \
198 else \
199 bOverFlow = true; \
200 if (bOverFlow) \
201 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim!
203 #define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \
204 if ( nr < ppc64::MAX_SSE_REGS ) \
205 pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \
206 else \
207 bOverFlow = true; \
208 if (bOverFlow) \
209 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim!
211 #define INSERT_INT64( pSV, nr, pGPR, pDS, bOverflow ) \
212 if ( nr < ppc64::MAX_GPR_REGS ) \
213 pGPR[nr++] = *reinterpret_cast<sal_uInt64 *>( pSV ); \
214 else \
215 bOverFlow = true; \
216 if (bOverFlow) \
217 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV );
219 #define INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow ) \
220 if ( nr < ppc64::MAX_GPR_REGS ) \
221 pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
222 else \
223 bOverFlow = true; \
224 if (bOverFlow) \
225 *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
227 #define INSERT_INT16( pSV, nr, pGPR, pDS, bOverflow ) \
228 if ( nr < ppc64::MAX_GPR_REGS ) \
229 pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
230 else \
231 bOverFlow = true; \
232 if (bOverFlow) \
233 *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
235 #define INSERT_INT8( pSV, nr, pGPR, pDS, bOverflow ) \
236 if ( nr < ppc64::MAX_GPR_REGS ) \
237 pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \
238 else \
239 bOverFlow = true; \
240 if (bOverFlow) \
241 *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV );
243 //==================================================================================================
244 static void cpp_call(
245 bridges::cpp_uno::shared::UnoInterfaceProxy * pThis,
246 bridges::cpp_uno::shared::VtableSlot aVtableSlot,
247 typelib_TypeDescriptionReference * pReturnTypeRef,
248 sal_Int32 nParams, typelib_MethodParameter * pParams,
249 void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
251 // max space for: [complex ret ptr], values|ptr ...
252 sal_uInt64 * pStack = (sal_uInt64 *)alloca( (nParams+3) * sizeof(sal_Int64) );
253 sal_uInt64 * pStackStart = pStack;
255 sal_uInt64 pGPR[ppc64::MAX_GPR_REGS];
256 sal_uInt32 nGPR = 0;
258 double pFPR[ppc64::MAX_SSE_REGS];
259 sal_uInt32 nFPR = 0;
261 // return
262 typelib_TypeDescription * pReturnTypeDescr = 0;
263 TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
264 OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" );
266 void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
268 bool bOverFlow = false;
270 if (pReturnTypeDescr)
272 #ifdef CMC_DEBUG
273 fprintf(stderr, "return type is %d\n", pReturnTypeDescr->eTypeClass);
274 #endif
275 if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
277 pCppReturn = pUnoReturn; // direct way for simple types
278 #ifdef CMC_DEBUG
279 fprintf(stderr, "simple return\n");
280 #endif
282 else
284 // complex return via ptr
285 pCppReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )
286 ? alloca( pReturnTypeDescr->nSize ) : pUnoReturn);
287 #ifdef CMC_DEBUG
288 fprintf(stderr, "pCppReturn/pUnoReturn is %lx/%lx", pCppReturn, pUnoReturn);
289 #endif
290 INSERT_INT64( &pCppReturn, nGPR, pGPR, pStack, bOverFlow );
293 // push "this" pointer
294 void * pAdjustedThisPtr = reinterpret_cast< void ** >( pThis->getCppI() ) + aVtableSlot.offset;
295 #ifdef CMC_DEBUG
296 fprintf(stderr, "this pointer is %p\n", pAdjustedThisPtr);
297 #endif
298 INSERT_INT64( &pAdjustedThisPtr, nGPR, pGPR, pStack, bOverFlow );
300 // Args
301 void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams );
302 // indizes of values this have to be converted (interface conversion cpp<=>uno)
303 sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams);
304 // type descriptions for reconversions
305 typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
307 sal_Int32 nTempIndizes = 0;
309 #ifdef CMC_DEBUG
310 fprintf(stderr, "n params is %d\n", nParams);
311 #endif
313 for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
315 const typelib_MethodParameter & rParam = pParams[nPos];
316 typelib_TypeDescription * pParamTypeDescr = 0;
317 TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
319 #ifdef CMC_DEBUG
320 fprintf(stderr, "param %d is %d %d %d\n", nPos, rParam.bOut, bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ),
321 pParamTypeDescr->eTypeClass);
322 #endif
324 if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
326 // uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr,
327 uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], pParamTypeDescr,
328 pThis->getBridge()->getUno2Cpp() );
329 switch (pParamTypeDescr->eTypeClass)
331 case typelib_TypeClass_HYPER:
332 case typelib_TypeClass_UNSIGNED_HYPER:
333 #ifdef CMC_DEBUG
334 fprintf(stderr, "hyper is %lx\n", pCppArgs[nPos]);
335 #endif
336 INSERT_INT64( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
337 break;
338 case typelib_TypeClass_LONG:
339 case typelib_TypeClass_UNSIGNED_LONG:
340 case typelib_TypeClass_ENUM:
341 #ifdef CMC_DEBUG
342 fprintf(stderr, "long is %x\n", pCppArgs[nPos]);
343 #endif
344 INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
345 break;
346 case typelib_TypeClass_SHORT:
347 case typelib_TypeClass_CHAR:
348 case typelib_TypeClass_UNSIGNED_SHORT:
349 INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
350 break;
351 case typelib_TypeClass_BOOLEAN:
352 case typelib_TypeClass_BYTE:
353 INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
354 break;
355 case typelib_TypeClass_FLOAT:
356 INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow );
357 break;
358 case typelib_TypeClass_DOUBLE:
359 INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow );
360 break;
363 // no longer needed
364 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
367 else // ptr to complex value | ref
369 #ifdef CMC_DEBUG
370 fprintf(stderr, "complex type again %d\n", rParam.bIn);
371 #endif
372 if (! rParam.bIn) // is pure out
374 #ifdef CMC_DEBUG
375 fprintf(stderr, "complex size is %d\n", pParamTypeDescr->nSize );
376 #endif
377 // cpp out is constructed mem, uno out is not!
378 uno_constructData(
379 pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
380 pParamTypeDescr );
381 pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call
382 // will be released at reconversion
383 ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
385 // is in/inout
386 else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr ))
388 #ifdef CMC_DEBUG
389 fprintf(stderr, "this one\n");
390 #endif
391 uno_copyAndConvertData(
392 pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
393 pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
395 pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
396 // will be released at reconversion
397 ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
399 else // direct way
401 #ifdef CMC_DEBUG
402 fprintf(stderr, "that one, passing %lx through\n", pUnoArgs[nPos]);
403 #endif
404 pCppArgs[nPos] = pUnoArgs[nPos];
405 // no longer needed
406 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
408 INSERT_INT64( &(pCppArgs[nPos]), nGPR, pGPR, pStack, bOverFlow );
414 callVirtualMethod(
415 pAdjustedThisPtr, aVtableSlot.index,
416 pCppReturn, pReturnTypeDescr,
417 pStackStart, ( pStack - pStackStart ),
418 pGPR, nGPR,
419 pFPR, nFPR );
420 // NO exception occured...
421 *ppUnoExc = 0;
423 // reconvert temporary params
424 for ( ; nTempIndizes--; )
426 sal_Int32 nIndex = pTempIndizes[nTempIndizes];
427 typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes];
429 if (pParams[nIndex].bIn)
431 if (pParams[nIndex].bOut) // inout
433 uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
434 uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
435 pThis->getBridge()->getCpp2Uno() );
438 else // pure out
440 uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
441 pThis->getBridge()->getCpp2Uno() );
443 // destroy temp cpp param => cpp: every param was constructed
444 uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
446 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
448 // return value
449 if (pCppReturn && pUnoReturn != pCppReturn)
451 uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr,
452 pThis->getBridge()->getCpp2Uno() );
453 uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release );
456 catch (...)
458 // fill uno exception
459 fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions,
460 *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
462 // temporary params
463 for ( ; nTempIndizes--; )
465 sal_Int32 nIndex = pTempIndizes[nTempIndizes];
466 // destroy temp cpp param => cpp: every param was constructed
467 uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release );
468 TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
470 // return type
471 if (pReturnTypeDescr)
472 TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
478 namespace bridges { namespace cpp_uno { namespace shared {
480 void unoInterfaceProxyDispatch(
481 uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr,
482 void * pReturn, void * pArgs[], uno_Any ** ppException )
484 // is my surrogate
485 bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
486 = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI);
487 typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
489 switch (pMemberDescr->eTypeClass)
491 case typelib_TypeClass_INTERFACE_ATTRIBUTE:
494 VtableSlot aVtableSlot(
495 getVtableSlot(
496 reinterpret_cast<
497 typelib_InterfaceAttributeTypeDescription const * >(
498 pMemberDescr)));
500 if (pReturn)
502 // dependent dispatch
503 cpp_call(
504 pThis, aVtableSlot,
505 ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
506 0, 0, // no params
507 pReturn, pArgs, ppException );
509 else
511 // is SET
512 typelib_MethodParameter aParam;
513 aParam.pTypeRef =
514 ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
515 aParam.bIn = sal_True;
516 aParam.bOut = sal_False;
518 typelib_TypeDescriptionReference * pReturnTypeRef = 0;
519 OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") );
520 typelib_typedescriptionreference_new(
521 &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
523 // dependent dispatch
524 aVtableSlot.index += 1; //get then set method
525 cpp_call(
526 pThis, aVtableSlot,
527 pReturnTypeRef,
528 1, &aParam,
529 pReturn, pArgs, ppException );
531 typelib_typedescriptionreference_release( pReturnTypeRef );
534 break;
536 case typelib_TypeClass_INTERFACE_METHOD:
539 VtableSlot aVtableSlot(
540 getVtableSlot(
541 reinterpret_cast<
542 typelib_InterfaceMethodTypeDescription const * >(
543 pMemberDescr)));
544 switch (aVtableSlot.index)
546 // standard calls
547 case 1: // acquire uno interface
548 (*pUnoI->acquire)( pUnoI );
549 *ppException = 0;
550 break;
551 case 2: // release uno interface
552 (*pUnoI->release)( pUnoI );
553 *ppException = 0;
554 break;
555 case 0: // queryInterface() opt
557 typelib_TypeDescription * pTD = 0;
558 TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
559 if (pTD)
561 uno_Interface * pInterface = 0;
562 (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)(
563 pThis->pBridge->getUnoEnv(),
564 (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD );
566 if (pInterface)
568 ::uno_any_construct(
569 reinterpret_cast< uno_Any * >( pReturn ),
570 &pInterface, pTD, 0 );
571 (*pInterface->release)( pInterface );
572 TYPELIB_DANGER_RELEASE( pTD );
573 *ppException = 0;
574 break;
576 TYPELIB_DANGER_RELEASE( pTD );
578 } // else perform queryInterface()
579 default:
580 // dependent dispatch
581 cpp_call(
582 pThis, aVtableSlot,
583 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
584 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
585 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
586 pReturn, pArgs, ppException );
588 break;
590 default:
592 ::com::sun::star::uno::RuntimeException aExc(
593 OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ),
594 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
596 Type const & rExcType = ::getCppuType( &aExc );
597 // binary identical null reference
598 ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
603 } } }