diff options
61 files changed, 2721 insertions, 279 deletions
diff --git a/bridges/prj/build.lst b/bridges/prj/build.lst index c6e342520672..0e7979742562 100644 --- a/bridges/prj/build.lst +++ b/bridges/prj/build.lst @@ -12,16 +12,17 @@ br bridges\source\cpp_uno\gcc3_os2_intel nmake - p br_gcc3os br_cppuno_shared br br bridges\source\cpp_uno\gcc3_freebsd_intel nmake - u br_gcc3fi br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\gcc3_linux_x86-64 nmake - u br_gcc3lx br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\gcc3_freebsd_x86-64 nmake - u br_gcc3fx br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_powerpc nmake - u br_gcclp3 br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_powerpc64 nmake - u br_gcclp3_64 br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_mips nmake - u br_gcc3mips br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_m68k nmake - u br_gcc3m68k br_cppuno_shared br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_s390 nmake - u br_gccl33 br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_s390x nmake - u br_gccl3x br_unotypes br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_sparc nmake - u br_gccl3s br_unotypes br_cppuno_shared br_inc NULL -br bridges\source\cpp_uno\gcc3_linux_arm nmake - u br_gccl3r br_unotypes NULL -br bridges\source\cpp_uno\gcc3_linux_ia64 nmake - u br_gccl3a br_unotypes NULL -br bridges\source\cpp_uno\gcc3_linux_hppa nmake - u br_gccl3h br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_powerpc nmake - u br_gcc3lp br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_powerpc64 nmake - u br_gcc3lp_64 br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_mips nmake - u br_gcc3lmips br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_m68k nmake - u br_gcc3lm68k br_cppuno_shared br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_s390 nmake - u br_gcc3l3 br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_s390x nmake - u br_gcc3l3_64 br_unotypes br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_sparc nmake - u br_gcc3ls br_unotypes br_cppuno_shared br_inc NULL +br bridges\source\cpp_uno\gcc3_linux_arm nmake - u br_gcc3lr br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_ia64 nmake - u br_gcc3la br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_hppa nmake - u br_gcc3lh br_unotypes NULL +br bridges\source\cpp_uno\gcc3_linux_alpha nmake - u br_gcc3ll br_unotypes NULL br bridges\source\cpp_uno\gcc3_macosx_intel nmake - u br_gcc3macoxi br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\gcc3_macosx_powerpc nmake - u br_gcc3macoxp br_cppuno_shared br_unotypes br_inc NULL br bridges\source\cpp_uno\cc50_solaris_sparc nmake - u br_cc50sols br_unotypes br_cppuno_shared br_inc NULL diff --git a/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk index 1e00634bd6a3..87ff690dd653 100644 --- a/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk @@ -77,8 +77,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).o $< touch $@ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx new file mode 100644 index 000000000000..abc5ce67e4b4 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx @@ -0,0 +1,676 @@ +/************************************************************************* + * + * 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_bridges.hxx" + +#include <com/sun/star/uno/genfunc.hxx> +#include <uno/data.h> +#include <typelib/typedescription.hxx> + +#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" +#include "bridges/cpp_uno/shared/types.hxx" +#include "bridges/cpp_uno/shared/vtablefactory.hxx" + +#include "share.hxx" +#include <stdio.h> + +//Calling Standards: +// "Calling Standard for Alpha Systems" +// (Tru64 UNIX Version 5.1 or higher, August 2000) +//http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/V51_HTML/ARH9MBTE/TITLE.HTM + +using namespace ::com::sun::star::uno; + +namespace +{ +static typelib_TypeClass cpp2uno_call( + bridges::cpp_uno::shared::CppInterfaceProxy * pThis, + const typelib_TypeDescription * pMemberTypeDescr, + typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return + sal_Int32 nParams, typelib_MethodParameter * pParams, + void ** gpreg, void ** fpreg, void ** ovrflw, + sal_Int64 * pRegisterReturn /* space for register return */ ) +{ +#ifdef CMC_DEBUG + fprintf(stderr, "as far as cpp2uno_call\n"); +#endif + int nregs = 0; //number of words passed in registers + + // gpreg: [ret *], this, [gpr params] + // fpreg: [fpr params] + // ovrflw: [gpr or fpr params (properly aligned)] + + // return + typelib_TypeDescription * pReturnTypeDescr = 0; + if (pReturnTypeRef) + TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); + + void * pUnoReturn = 0; + void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need + + if (pReturnTypeDescr) + { + if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) + { + pUnoReturn = pRegisterReturn; // direct way for simple types + } + else // complex return via ptr (pCppReturn) + { + pCppReturn = *(void **)gpreg; + gpreg++; + fpreg++; + nregs++; + + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) + ? alloca( pReturnTypeDescr->nSize ) + : pCppReturn); // direct way + } + } + // pop this + gpreg++; + fpreg++; + nregs++; + + // stack space + OSL_ENSURE( sizeof(void *) == sizeof(sal_Int64), "### unexpected size!" ); + // parameters + void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams ); + void ** pCppArgs = pUnoArgs + nParams; + // indizes of values this have to be converted (interface conversion cpp<=>uno) + sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); + // type descriptions for reconversions + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); + + sal_Int32 nTempIndizes = 0; + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) + { + const typelib_MethodParameter & rParam = pParams[nPos]; + typelib_TypeDescription * pParamTypeDescr = 0; + TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); + +#ifdef CMC_DEBUG + fprintf(stderr, "arg %d of %d\n", nPos, nParams); +#endif + + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value + { +#ifdef CMC_DEBUG + fprintf(stderr, "simple type is %d\n", pParamTypeDescr->eTypeClass); +#endif + + switch (pParamTypeDescr->eTypeClass) + { + case typelib_TypeClass_FLOAT: + case typelib_TypeClass_DOUBLE: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + if (pParamTypeDescr->eTypeClass == typelib_TypeClass_FLOAT) + { + float tmp = (float) (*((double *)fpreg)); + (*((float *) fpreg)) = tmp; + } + + pCppArgs[nPos] = pUnoArgs[nPos] = fpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + case typelib_TypeClass_BYTE: + case typelib_TypeClass_BOOLEAN: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_SHORT: + case typelib_TypeClass_UNSIGNED_SHORT: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + case typelib_TypeClass_ENUM: + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + default: + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pUnoArgs[nPos] = gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw; + ovrflw++; + } + break; + } + + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + else // ptr to complex value | ref + { +#ifdef CMC_DEBUG + fprintf(stderr, "complex, nregs is %d\n", nregs); +#endif + + void *pCppStack; //temporary stack pointer + + if (nregs < axp::MAX_WORDS_IN_REGS) + { + pCppArgs[nPos] = pCppStack = *gpreg; + gpreg++; + fpreg++; + nregs++; + } + else + { + pCppArgs[nPos] = pCppStack = *ovrflw; + ovrflw++; + } + + if (! rParam.bIn) // is pure out + { + // uno out is unconstructed mem! + pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ); + pTempIndizes[nTempIndizes] = nPos; + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + // is in/inout + else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) + { + uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), + pCppStack, pParamTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + else // direct way + { + pUnoArgs[nPos] = pCppStack; + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + } + } + +#ifdef CMC_DEBUG + fprintf(stderr, "end of params\n"); +#endif + + // ExceptionHolder + uno_Any aUnoExc; // Any will be constructed by callee + uno_Any * pUnoExc = &aUnoExc; + + // invoke uno dispatch call + (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); + + // in case an exception occured... + if (pUnoExc) + { + // destruct temporary in/inout params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + + if (pParams[nIndex].bIn) // is in/inout => was constructed + uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); + TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); + } + if (pReturnTypeDescr) + TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any + // is here for dummy + return typelib_TypeClass_VOID; + } + else // else no exception occured... + { + // temporary params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; + + if (pParams[nIndex].bOut) // inout/out + { + // convert and assign + uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); + uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + } + // destroy temp uno param + uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); + + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + // return + if (pCppReturn) // has complex return + { + if (pUnoReturn != pCppReturn) // needs reconversion + { + uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + // destroy temp uno return + uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); + } + // complex return ptr is set to return reg + *(void **)pRegisterReturn = pCppReturn; + } + if (pReturnTypeDescr) + { + typelib_TypeClass eRet = (typelib_TypeClass)pReturnTypeDescr->eTypeClass; + TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); + return eRet; + } + else + return typelib_TypeClass_VOID; + } +} + + +//============================================================================ +static typelib_TypeClass cpp_mediate( + sal_uInt64 nOffsetAndIndex, + void ** gpreg, void ** fpreg, void ** ovrflw, + sal_Int64 * pRegisterReturn /* space for register return */ ) +{ + OSL_ENSURE( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" ); + + sal_Int32 nVtableOffset = (nOffsetAndIndex >> 32); + sal_Int32 nFunctionIndex = (nOffsetAndIndex & 0xFFFFFFFF); + +#ifdef CMC_DEBUG + fprintf(stderr, "nVTableOffset, nFunctionIndex are %x %x\n", nVtableOffset, nFunctionIndex); +#endif + +#ifdef CMC_DEBUG + // Let's figure out what is really going on here + { + fprintf( stderr, "= cpp_mediate () =\nGPR's (%d): ", 6 ); + for ( unsigned int i = 0; i < 6; ++i ) + fprintf( stderr, "0x%lx, ", gpreg[i] ); + fprintf( stderr, "\n"); + fprintf( stderr, "\nFPR's (%d): ", 6 ); + for ( unsigned int i = 0; i < 6; ++i ) + fprintf( stderr, "0x%lx (%f), ", fpreg[i], fpreg[i] ); + fprintf( stderr, "\n"); + } +#endif + + + // gpreg: [ret *], this, [other gpr params] + // fpreg: [fpr params] + // ovrflw: [gpr or fpr params (properly aligned)] + + // _this_ ptr is patched cppu_XInterfaceProxy object + void * pThis; + if( nFunctionIndex & 0x80000000 ) + { + nFunctionIndex &= 0x7fffffff; + pThis = gpreg[1]; + } + else + { + pThis = gpreg[0]; + } + + pThis = static_cast< char * >(pThis) - nVtableOffset; + + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI + = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( + pThis); + + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); + + + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); + if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) + { + throw RuntimeException( + rtl::OUString::createFromAscii("illegal vtable index!"), + (XInterface *)pCppI ); + } + + // determine called method + OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); + sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; + OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); + + TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); + + typelib_TypeClass eRet; + switch (aMemberDescr.get()->eTypeClass) + { + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex) + { + // is GET method + eRet = cpp2uno_call( + pCppI, aMemberDescr.get(), + ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef, + 0, 0, // no params + gpreg, fpreg, ovrflw, pRegisterReturn ); + } + else + { + // is SET method + typelib_MethodParameter aParam; + aParam.pTypeRef = + ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; + aParam.bIn = sal_True; + aParam.bOut = sal_False; + + eRet = cpp2uno_call( + pCppI, aMemberDescr.get(), + 0, // indicates void return + 1, &aParam, + gpreg, fpreg, ovrflw, pRegisterReturn ); + } + break; + } + case typelib_TypeClass_INTERFACE_METHOD: + { + // is METHOD + switch (nFunctionIndex) + { + case 1: // acquire() + pCppI->acquireProxy(); // non virtual call! + eRet = typelib_TypeClass_VOID; + break; + case 2: // release() + pCppI->releaseProxy(); // non virtual call! + eRet = typelib_TypeClass_VOID; + break; + case 0: // queryInterface() opt + { + typelib_TypeDescription * pTD = 0; + TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( gpreg[2] )->getTypeLibType() ); + if (pTD) + { + XInterface * pInterface = 0; + (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( + pCppI->getBridge()->getCppEnv(), + (void **)&pInterface, pCppI->getOid().pData, + (typelib_InterfaceTypeDescription *)pTD ); + + if (pInterface) + { + ::uno_any_construct( + reinterpret_cast< uno_Any * >( gpreg[0] ), + &pInterface, pTD, cpp_acquire ); + pInterface->release(); + TYPELIB_DANGER_RELEASE( pTD ); + *(void **)pRegisterReturn = gpreg[0]; + eRet = typelib_TypeClass_ANY; + break; + } + TYPELIB_DANGER_RELEASE( pTD ); + } + } // else perform queryInterface() + default: + eRet = cpp2uno_call( + pCppI, aMemberDescr.get(), + ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef, + ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams, + ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams, + gpreg, fpreg, ovrflw, pRegisterReturn ); + } + break; + } + default: + { + throw RuntimeException( + rtl::OUString::createFromAscii("no member description found!"), + (XInterface *)pCppI ); + // is here for dummy + eRet = typelib_TypeClass_VOID; + } + } + + return eRet; +} + +long cpp_vtable_call(long r16, long r17, long r18, long r19, long r20, long r21, long firstonstack) +{ + register long r1 asm("$1"); + sal_uInt64 nOffsetAndIndex = r1; + + long sp = (long)&firstonstack; + + sal_uInt64 gpreg[axp::MAX_GPR_REGS]; + gpreg[0] = r16; + gpreg[1] = r17; + gpreg[2] = r18; + gpreg[3] = r19; + gpreg[4] = r20; + gpreg[5] = r21; + + double fpreg[axp::MAX_SSE_REGS]; + register double f16 asm("$f16"); fpreg[0] = f16; + register double f17 asm("$f17"); fpreg[1] = f17; + register double f18 asm("$f18"); fpreg[2] = f18; + register double f19 asm("$f19"); fpreg[3] = f19; + register double f20 asm("$f20"); fpreg[4] = f20; + register double f21 asm("$f21"); fpreg[5] = f21; + + volatile long nRegReturn[1]; +#ifdef CMC_DEBUG + fprintf(stderr, "before mediate with %lx\n",nOffsetAndIndex); + fprintf(stderr, "non-doubles are %x %x %x %x %x %x\n", gpreg[0], gpreg[1], gpreg[2], gpreg[3], gpreg[4], gpreg[5]); + fprintf(stderr, "doubles are %f %f %f %f %f %f\n", fpreg[0], fpreg[1], fpreg[2], fpreg[3], fpreg[4], fpreg[5]); +#endif + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, (void**)sp, + (sal_Int64*)nRegReturn ); +#ifdef CMC_DEBUG + fprintf(stderr, "after mediate ret is %lx %ld\n", nRegReturn[0], nRegReturn[0]); +#endif + + switch( aType ) + { + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + nRegReturn[0] = (unsigned long)(*(unsigned char *)nRegReturn); + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + case typelib_TypeClass_SHORT: + nRegReturn[0] = (unsigned long)(*(unsigned short *)nRegReturn); + break; + case typelib_TypeClass_ENUM: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_LONG: + nRegReturn[0] = (unsigned long)(*(unsigned int *)nRegReturn); + break; + case typelib_TypeClass_VOID: + default: + break; + case typelib_TypeClass_FLOAT: + { + double tmp = (double) (*((float *)nRegReturn)); + (*((double *) nRegReturn)) = tmp; + } + //deliberate fall through + case typelib_TypeClass_DOUBLE: + __asm__ ( "ldt $f0,%0\n\t" + : : "m" (*((double*)nRegReturn)) : "$f0"); + break; + } + return nRegReturn[0]; +} + +const int codeSnippetSize = 32; + +unsigned char *codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool simple_ret_type ) +{ + if (! simple_ret_type) + nFunctionIndex |= 0x80000000; + + unsigned char * p = code; + *(unsigned int*)&p[0] = 0x47fb0401; /* mov $27,$1 */ + *(unsigned int*)&p[4] = 0xa43b0010; /* ldq $1,16($27) */ + *(unsigned int*)&p[8] = 0xa77b0018; /* ldq $27,24($27) */ + *(unsigned int*)&p[12] = 0x6bfb0000; /* jmp $31,($27),0 */ + *(unsigned int*)&p[16] = nFunctionIndex; + *(unsigned int*)&p[20] = nVtableOffset; + *(unsigned long*)&p[24] = (unsigned long)cpp_vtable_call; + return (code + codeSnippetSize); +} +} + +void bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const *, unsigned char const *) +{ + //http://www.gnu.org/software/lightning/manual/html_node/Standard-functions.html + __asm__ __volatile__("call_pal 0x86"); +} + +struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; + +bridges::cpp_uno::shared::VtableFactory::Slot * +bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) +{ + return static_cast< Slot * >(block) + 2; +} + +sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( + sal_Int32 slotCount) +{ + return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; +} + +bridges::cpp_uno::shared::VtableFactory::Slot * +bridges::cpp_uno::shared::VtableFactory::initializeBlock( + void * block, sal_Int32 slotCount) +{ + Slot * slots = mapBlockToVtable(block); + slots[-2].fn = 0; + slots[-1].fn = 0; + return slots + slotCount; +} + +unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( + Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff, + typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, + sal_Int32 functionCount, sal_Int32 vtableOffset) +{ + (*slots) -= functionCount; + Slot * s = *slots; +#ifdef CMC_DEBUG + fprintf(stderr, "in addLocalFunctions functionOffset is %x\n",functionOffset); + fprintf(stderr, "in addLocalFunctions vtableOffset is %x\n",vtableOffset); +#endif + + for (sal_Int32 i = 0; i < type->nMembers; ++i) { + typelib_TypeDescription * member = 0; + TYPELIB_DANGER_GET(&member, type->ppMembers[i]); + OSL_ASSERT(member != 0); + switch (member->eTypeClass) { + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + // Getter: + (s++)->fn = code + writetoexecdiff; + code = codeSnippet( + code, functionOffset++, vtableOffset, + bridges::cpp_uno::shared::isSimpleType( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription * >( + member)->pAttributeTypeRef)); + + // Setter: + if (!reinterpret_cast< + typelib_InterfaceAttributeTypeDescription * >( + member)->bReadOnly) + { + (s++)->fn = code + writetoexecdiff; + code = codeSnippet(code, functionOffset++, vtableOffset, true); + } + break; + + case typelib_TypeClass_INTERFACE_METHOD: + (s++)->fn = code + writetoexecdiff; + code = codeSnippet( + code, functionOffset++, vtableOffset, + bridges::cpp_uno::shared::isSimpleType( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription * >( + member)->pReturnTypeRef)); + break; + + default: + OSL_ASSERT(false); + break; + } + TYPELIB_DANGER_RELEASE(member); + } + return code; +} + +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx new file mode 100644 index 000000000000..3e666a11cdd0 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx @@ -0,0 +1,287 @@ +/************************************************************************* + * + * 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_bridges.hxx" + +#include <stdio.h> +#include <string.h> +#include <dlfcn.h> +#include <cxxabi.h> +#include <hash_map> + +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> +#include <osl/diagnose.h> +#include <osl/mutex.hxx> + +#include <com/sun/star/uno/genfunc.hxx> +#include <typelib/typedescription.hxx> +#include <uno/any2.h> + +#include "share.hxx" + + +using namespace ::std; +using namespace ::osl; +using namespace ::rtl; +using namespace ::com::sun::star::uno; +using namespace ::__cxxabiv1; + + +namespace CPPU_CURRENT_NAMESPACE +{ + +void dummy_can_throw_anything( char const * ) +{ +} + +//================================================================================================== +static OUString toUNOname( char const * p ) SAL_THROW( () ) +{ +#if OSL_DEBUG_LEVEL > 1 + char const * start = p; +#endif + + // example: N3com3sun4star4lang24IllegalArgumentExceptionE + + OUStringBuffer buf( 64 ); + OSL_ASSERT( 'N' == *p ); + ++p; // skip N + + while ('E' != *p) + { + // read chars count + long n = (*p++ - '0'); + while ('0' <= *p && '9' >= *p) + { + n *= 10; + n += (*p++ - '0'); + } + buf.appendAscii( p, n ); + p += n; + if ('E' != *p) + buf.append( (sal_Unicode)'.' ); + } + +#if OSL_DEBUG_LEVEL > 1 + OUString ret( buf.makeStringAndClear() ); + OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); + fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() ); + return ret; +#else + return buf.makeStringAndClear(); +#endif +} + +//================================================================================================== +class RTTI +{ + typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; + + Mutex m_mutex; + t_rtti_map m_rttis; + t_rtti_map m_generatedRttis; + + void * m_hApp; + +public: + RTTI() SAL_THROW( () ); + ~RTTI() SAL_THROW( () ); + + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); +}; +//__________________________________________________________________________________________________ +RTTI::RTTI() SAL_THROW( () ) + : m_hApp( dlopen( 0, RTLD_LAZY ) ) +{ +} +//__________________________________________________________________________________________________ +RTTI::~RTTI() SAL_THROW( () ) +{ + dlclose( m_hApp ); +} + +//__________________________________________________________________________________________________ +type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) +{ + type_info * rtti; + + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; + + MutexGuard guard( m_mutex ); + t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); + if (iRttiFind == m_rttis.end()) + { + // RTTI symbol + OStringBuffer buf( 64 ); + buf.append( RTL_CONSTASCII_STRINGPARAM("_ZTIN") ); + sal_Int32 index = 0; + do + { + OUString token( unoName.getToken( 0, '.', index ) ); + buf.append( token.getLength() ); + OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) ); + buf.append( c_token ); + } + while (index >= 0); + buf.append( 'E' ); + + OString symName( buf.makeStringAndClear() ); + rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); + + if (rtti) + { + pair< t_rtti_map::iterator, bool > insertion( + m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); + OSL_ENSURE( insertion.second, "### inserting new rtti failed?!" ); + } + else + { + // try to lookup the symbol in the generated rtti map + t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) ); + if (iFind == m_generatedRttis.end()) + { + // we must generate it ! + // symbol and rtti-name is nearly identical, + // the symbol is prefixed with _ZTI + char const * rttiName = symName.getStr() +4; +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr,"generated rtti for %s\n", rttiName ); +#endif + if (pTypeDescr->pBaseTypeDescription) + { + // ensure availability of base + type_info * base_rtti = getRTTI( + (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription ); + rtti = new __si_class_type_info( + strdup( rttiName ), (__class_type_info *)base_rtti ); + } + else + { + // this class has no base class + rtti = new __class_type_info( strdup( rttiName ) ); + } + + pair< t_rtti_map::iterator, bool > insertion( + m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); + OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); + } + else // taking already generated rtti + { + rtti = iFind->second; + } + } + } + else + { + rtti = iRttiFind->second; + } + + return rtti; +} + +//-------------------------------------------------------------------------------------------------- +static void deleteException( void * pExc ) +{ + __cxa_exception const * header = ((__cxa_exception const *)pExc - 1); + typelib_TypeDescription * pTD = 0; + OUString unoName( toUNOname( header->exceptionType->name() ) ); + ::typelib_typedescription_getByName( &pTD, unoName.pData ); + OSL_ENSURE( pTD, "### unknown exception type! leaving out destruction => leaking!!!" ); + if (pTD) + { + ::uno_destructData( pExc, pTD, cpp_release ); + ::typelib_typedescription_release( pTD ); + } +} + +//================================================================================================== +void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) +{ + void * pCppExc; + type_info * rtti; + + { + // construct cpp exception object + typelib_TypeDescription * pTypeDescr = 0; + TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType ); + OSL_ASSERT( pTypeDescr ); + if (! pTypeDescr) + terminate(); + + pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); + ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); + + // destruct uno exception + ::uno_any_destruct( pUnoExc, 0 ); + // avoiding locked counts + static RTTI * s_rtti = 0; + if (! s_rtti) + { + MutexGuard guard( Mutex::getGlobalMutex() ); + if (! s_rtti) + { +#ifdef LEAK_STATIC_DATA + s_rtti = new RTTI(); +#else + static RTTI rtti_data; + s_rtti = &rtti_data; +#endif + } + } + rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr ); + TYPELIB_DANGER_RELEASE( pTypeDescr ); + OSL_ENSURE( rtti, "### no rtti for throwing exception!" ); + if (! rtti) + terminate(); + } + + __cxa_throw( pCppExc, rtti, deleteException ); +} + +//================================================================================================== +void fillUnoException( __cxa_exception * header, uno_Any * pExc, uno_Mapping * pCpp2Uno ) +{ + OSL_ENSURE( header, "### no exception header!!!" ); + if (! header) + terminate(); + + typelib_TypeDescription * pExcTypeDescr = 0; + OUString unoName( toUNOname( header->exceptionType->name() ) ); + ::typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData ); + OSL_ENSURE( pExcTypeDescr, "### can not get type description for exception!!!" ); + if (! pExcTypeDescr) + terminate(); + + // construct uno exception any + ::uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno ); + ::typelib_typedescription_release( pExcTypeDescr ); +} + +} +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_alpha/makefile.mk new file mode 100644 index 000000000000..2650c4376933 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/makefile.mk @@ -0,0 +1,77 @@ +#************************************************************************* +# +# 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 +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=bridges +TARGET=gcc3_uno +LIBTARGET=no +ENABLE_EXCEPTIONS=TRUE + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXL" + +.IF "$(cppu_no_leak)" == "" +CFLAGS += -DLEAK_STATIC_DATA +.ENDIF + +# In case someone enabled the non-standard -fomit-frame-pointer which does not +# work with the .cxx sources in this directory: +CFLAGSCXX += -fno-omit-frame-pointer + +CFLAGSNOOPT=-O0 + +SLOFILES= \ + $(SLO)$/except.obj \ + $(SLO)$/cpp2uno.obj \ + $(SLO)$/uno2cpp.obj + +SHL1TARGET= $(TARGET) + +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +SHL1IMPLIB=i$(TARGET) +SHL1VERSIONMAP=..$/..$/bridge_exports.map +SHL1RPATH=URELIB + +SHL1OBJS = $(SLOFILES) +SHL1LIBS = $(SLB)$/cpp_uno_shared.lib + +SHL1STDLIBS= \ + $(CPPULIB) \ + $(SALLIB) + +.ENDIF + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx b/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx new file mode 100644 index 000000000000..c2f0189a2065 --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "uno/mapping.h" + +#include <typeinfo> +#include <exception> +#include <cstddef> + +namespace CPPU_CURRENT_NAMESPACE +{ + + void dummy_can_throw_anything( char const * ); + + +// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h + +struct _Unwind_Exception +{ + unsigned exception_class __attribute__((__mode__(__DI__))); + void * exception_cleanup; + unsigned private_1 __attribute__((__mode__(__word__))); + unsigned private_2 __attribute__((__mode__(__word__))); +} __attribute__((__aligned__)); + +struct __cxa_exception +{ + ::std::type_info *exceptionType; + void (*exceptionDestructor)(void *); + + ::std::unexpected_handler unexpectedHandler; + ::std::terminate_handler terminateHandler; + + __cxa_exception *nextException; + + int handlerCount; + + int handlerSwitchValue; + const unsigned char *actionRecord; + const unsigned char *languageSpecificData; + void *catchTemp; + void *adjustedPtr; + + _Unwind_Exception unwindHeader; +}; + +extern "C" void *__cxa_allocate_exception( + std::size_t thrown_size ) throw(); +extern "C" void __cxa_throw ( + void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); + +struct __cxa_eh_globals +{ + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; +extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); + +// ----- + +//================================================================================================== +void raiseException( + uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); +//================================================================================================== +void fillUnoException( + __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); +} + +namespace axp +{ + enum axplimits { MAX_WORDS_IN_REGS = 6, MAX_GPR_REGS = 6, MAX_SSE_REGS = 6 }; +} + +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx new file mode 100644 index 000000000000..7f51d425806c --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx @@ -0,0 +1,532 @@ +/************************************************************************* + * + * 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_bridges.hxx" + +#include <malloc.h> + +#include <com/sun/star/uno/genfunc.hxx> +#include <uno/data.h> + +#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridges/cpp_uno/shared/types.hxx" +#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" +#include "bridges/cpp_uno/shared/vtables.hxx" + +#include "share.hxx" + +#include <stdio.h> +#include <string.h> + + +using namespace ::rtl; +using namespace ::com::sun::star::uno; + +void MapReturn(long r0, typelib_TypeClass eTypeClass, sal_uInt64* pRegisterReturn) +{ + register float fret asm("$f0"); + register double dret asm("$f0"); + +#ifdef CMC_DEBUG + fprintf(stderr,"Mapping Return with %lx %ld %f\n", r0, r0, dret); +#endif + switch (eTypeClass) + { + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: + *pRegisterReturn = r0; + break; + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: + *(unsigned int*)pRegisterReturn = (unsigned int)r0; + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_SHORT: + case typelib_TypeClass_UNSIGNED_SHORT: + *(unsigned short*)pRegisterReturn = (unsigned short)r0; + break; + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + *(unsigned char*)pRegisterReturn = (unsigned char)r0; + break; + case typelib_TypeClass_FLOAT: + *reinterpret_cast<float *>( pRegisterReturn ) = fret; + break; + case typelib_TypeClass_DOUBLE: + *reinterpret_cast<double *>( pRegisterReturn ) = dret; + break; + default: + break; + } +#ifdef CMC_DEBUG + fprintf(stderr, "end of MapReturn with %x\n", pRegisterReturn ? *pRegisterReturn : 0); +#endif +} + +#define INSERT_FLOAT( pSV, nr, pFPR, pDS ) \ + { \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + { \ + pFPR[nr++] = *reinterpret_cast<float *>( pSV ); \ + } \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); \ + } + +#define INSERT_DOUBLE( pSV, nr, pFPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim! + +#define INSERT_INT64( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt64 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); + +#define INSERT_INT32( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV ); + +#define INSERT_INT16( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV ); + +#define INSERT_INT8( pSV, nr, pGPR, pDS ) \ + if ( nr < axp::MAX_WORDS_IN_REGS ) \ + pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \ + else \ + *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); + +namespace +{ +//================================================================================================== +void callVirtualMethod( + void * pThis, sal_Int32 nVtableIndex, + void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, + sal_uInt64 *pStack, sal_uInt32 nStack, + sal_uInt64 *pGPR, sal_uInt32 nGPR, + double *pFPR, sal_uInt32 nFPR) +{ + // Should not happen, but... + if ( nFPR > axp::MAX_SSE_REGS ) + nFPR = axp::MAX_SSE_REGS; + if ( nGPR > axp::MAX_GPR_REGS ) + nGPR = axp::MAX_GPR_REGS; + +#ifdef CMC_DEBUG + // Let's figure out what is really going on here + { + fprintf( stderr, "= nStack is %d\n", nStack ); + fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR ); + for ( unsigned int i = 0; i < nGPR; ++i ) + fprintf( stderr, "0x%lx, ", pGPR[i] ); + fprintf( stderr, "\nFPR's (%d): ", nFPR ); + for ( unsigned int i = 0; i < nFPR; ++i ) + fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] ); + fprintf( stderr, "\nStack (%d): ", nStack ); + for ( unsigned int i = 0; i < nStack; ++i ) + fprintf( stderr, "0x%lx, ", pStack[i] ); + fprintf( stderr, "\n" ); + fprintf( stderr, "pRegisterReturn is %p\n", pRegisterReturn); + } +#endif + + // Load parameters to stack, if necessary + // Stack, if used, must be 8-bytes aligned + sal_uInt64 *stack = (sal_uInt64 *) __builtin_alloca( nStack * 8 ); + memcpy( stack, pStack, nStack * 8 ); + + // To get pointer to method + // a) get the address of the vtable + sal_uInt64 pMethod = *((sal_uInt64 *)pThis); + // b) get the address from the vtable entry at offset + pMethod += 8 * nVtableIndex; + pMethod = *((sal_uInt64 *)pMethod); + + typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 ); + FunctionCall pFunc = (FunctionCall)pMethod; + + switch (nFPR) //deliberate fall through + { + case 6: + asm volatile("ldt $f16,%0" :: "m"(pFPR[5]) : "$f16"); + case 5: + asm volatile("ldt $f17,%0" :: "m"(pFPR[4]) : "$f17"); + case 4: + asm volatile("ldt $f18,%0" :: "m"(pFPR[3]) : "$f18"); + case 3: + asm volatile("ldt $f19,%0" :: "m"(pFPR[2]) : "$f19"); + case 2: + asm volatile("ldt $f20,%0" :: "m"(pFPR[1]) : "$f20"); + case 1: + asm volatile("ldt $f21,%0" :: "m"(pFPR[0]) : "$f21"); + default: + break; + } + + (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5]); + register sal_uInt64 r0 __asm__("$0"); + MapReturn(r0, pReturnTypeDescr->eTypeClass, (sal_uInt64*)pRegisterReturn); +} + + +//============================================================================ +static void cpp_call( + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, + bridges::cpp_uno::shared::VtableSlot aVtableSlot, + typelib_TypeDescriptionReference * pReturnTypeRef, + sal_Int32 nParams, typelib_MethodParameter * pParams, + void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) +{ + // max space for: [complex ret ptr], values|ptr ... + sal_uInt64 * pStack = (sal_uInt64 *)alloca( (nParams+3) * sizeof(sal_Int64) ); + sal_uInt64 * pStackStart = pStack; + + sal_uInt64 pGPR[axp::MAX_GPR_REGS]; + double pFPR[axp::MAX_SSE_REGS]; + sal_uInt32 nRegs = 0; + + // return + typelib_TypeDescription * pReturnTypeDescr = 0; + TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); + OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); + + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion + + if (pReturnTypeDescr) + { + if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) + { + pCppReturn = pUnoReturn; // direct way for simple types + } + else + { + // complex return via ptr + pCppReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) + ? alloca( pReturnTypeDescr->nSize ) + : pUnoReturn); // direct way + INSERT_INT64( &pCppReturn, nRegs, pGPR, pStack ); + } + } + // push "this" pointer + void * pAdjustedThisPtr = reinterpret_cast< void ** >( pThis->getCppI() ) + aVtableSlot.offset; + + INSERT_INT64( &pAdjustedThisPtr, nRegs, pGPR, pStack ); + + // stack space + OSL_ENSURE( sizeof(void *) == sizeof(sal_Int64), "### unexpected size!" ); + // args + void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); + // indizes of values this have to be converted (interface conversion cpp<=>uno) + sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); + // type descriptions for reconversions + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); + + sal_Int32 nTempIndizes = 0; + + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) + { + const typelib_MethodParameter & rParam = pParams[nPos]; + typelib_TypeDescription * pParamTypeDescr = 0; + TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); + + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + { + uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + + switch (pParamTypeDescr->eTypeClass) + { + case typelib_TypeClass_HYPER: + case typelib_TypeClass_UNSIGNED_HYPER: + INSERT_INT64( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_LONG: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_ENUM: + INSERT_INT32( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_SHORT: + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + INSERT_INT16( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + INSERT_INT8( pCppArgs[nPos], nRegs, pGPR, pStack ); + break; + case typelib_TypeClass_FLOAT: + INSERT_FLOAT( pCppArgs[nPos], nRegs, pFPR, pStack ); + break; + case typelib_TypeClass_DOUBLE: + INSERT_DOUBLE( pCppArgs[nPos], nRegs, pFPR, pStack ); + break; + default: + break; + } + + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + else // ptr to complex value | ref + { + if (! rParam.bIn) // is pure out + { + // cpp out is constructed mem, uno out is not! + uno_constructData( + pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), + pParamTypeDescr ); + pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + // is in/inout + else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) + { + uno_copyAndConvertData( + pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), + pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); + + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted + // will be released at reconversion + ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; + } + else // direct way + { + pCppArgs[nPos] = pUnoArgs[nPos]; + // no longer needed + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + INSERT_INT64( &(pCppArgs[nPos]), nRegs, pGPR, pStack ); + } + } + + try + { + callVirtualMethod( + pAdjustedThisPtr, aVtableSlot.index, + pCppReturn, pReturnTypeDescr, + pStackStart, (pStack - pStackStart), + pGPR, nRegs, + pFPR, nRegs ); + // NO exception occured... + *ppUnoExc = 0; + + // reconvert temporary params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; + + if (pParams[nIndex].bIn) + { + if (pParams[nIndex].bOut) // inout + { + uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value + uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + } + } + else // pure out + { + uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + } + // destroy temp cpp param => cpp: every param was constructed + uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); + + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); + } + // return value + if (pCppReturn && pUnoReturn != pCppReturn) + { + uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr, + pThis->getBridge()->getCpp2Uno() ); + uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release ); + } + } + catch (...) + { + // fill uno exception + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); + + + // temporary params + for ( ; nTempIndizes--; ) + { + sal_Int32 nIndex = pTempIndizes[nTempIndizes]; + // destroy temp cpp param => cpp: every param was constructed + uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release ); + TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); + } + // return type + if (pReturnTypeDescr) + TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); + } +} +} + +namespace bridges { namespace cpp_uno { namespace shared { + +void unoInterfaceProxyDispatch( + uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr, + void * pReturn, void * pArgs[], uno_Any ** ppException ) +{ +#ifdef CMC_DEBUG + fprintf(stderr, "unoInterfaceProxyDispatch\n"); +#endif + + + // is my surrogate + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); + + switch (pMemberDescr->eTypeClass) + { + case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + + VtableSlot aVtableSlot( + getVtableSlot( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription const * >( + pMemberDescr))); + + if (pReturn) + { + // dependent dispatch + cpp_call( + pThis, aVtableSlot, + ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, + 0, 0, // no params + pReturn, pArgs, ppException ); + } + else + { + // is SET + typelib_MethodParameter aParam; + aParam.pTypeRef = + ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; + aParam.bIn = sal_True; + aParam.bOut = sal_False; + + typelib_TypeDescriptionReference * pReturnTypeRef = 0; + OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); + typelib_typedescriptionreference_new( + &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); + + // dependent dispatch + aVtableSlot.index += 1; //get then set method + cpp_call( + pThis, aVtableSlot, + pReturnTypeRef, + 1, &aParam, + pReturn, pArgs, ppException ); + + typelib_typedescriptionreference_release( pReturnTypeRef ); + } + + break; + } + case typelib_TypeClass_INTERFACE_METHOD: + { + + VtableSlot aVtableSlot( + getVtableSlot( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription const * >( + pMemberDescr))); + switch (aVtableSlot.index) + { + // standard calls + case 1: // acquire uno interface + (*pUnoI->acquire)( pUnoI ); + *ppException = 0; + break; + case 2: // release uno interface + (*pUnoI->release)( pUnoI ); + *ppException = 0; + break; + case 0: // queryInterface() opt + { + typelib_TypeDescription * pTD = 0; + TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() ); + if (pTD) + { + uno_Interface * pInterface = 0; + (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( + pThis->pBridge->getUnoEnv(), + (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); + + if (pInterface) + { + ::uno_any_construct( + reinterpret_cast< uno_Any * >( pReturn ), + &pInterface, pTD, 0 ); + (*pInterface->release)( pInterface ); + TYPELIB_DANGER_RELEASE( pTD ); + *ppException = 0; + break; + } + TYPELIB_DANGER_RELEASE( pTD ); + } + } // else perform queryInterface() + default: + // dependent dispatch + cpp_call( + pThis, aVtableSlot, + ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef, + ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams, + ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams, + pReturn, pArgs, ppException ); + } + break; + } + default: + { + ::com::sun::star::uno::RuntimeException aExc( + OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); + + Type const & rExcType = ::getCppuType( &aExc ); + // binary identical null reference + ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); + } + } +} + +} } } +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S new file mode 100644 index 000000000000..d5faf15eed6f --- /dev/null +++ b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.S @@ -0,0 +1,38 @@ +@ ARM support code for OpenOffice C++/UNO bridging +@ +@ Written by Peter Naulls <peter@chocky.org> +@ Modified by Caolan McNamara <caolanm@redhat.com> +@ Fixed by Michael Casadevall <mcasadevall@kubuntu.org> + +#ifdef __ARM_EABI__ +# define UNWIND +#else +# define UNWIND @ +#endif + + .file "armhelper.s" + .text + .align 4 + .global privateSnippetExecutor + .type privateSnippetExecutor, %function +privateSnippetExecutor: + UNWIND .fnstart @ start of unwinder entry + + stmfd sp!, {r0-r3} @ follow other parameters on stack + UNWIND .pad #16 @ throw this data away on exception + mov r0, ip @ r0 points to functionoffset/vtable + mov r1, sp @ r1 points to this and params + @ (see cppuno.cxx:codeSnippet()) + stmfd sp!, {r4,lr} @ save return address + @ (r4 pushed to preserve stack alignment) + UNWIND .save {r4,lr} @ restore these regs on exception + + bl cpp_vtable_call(PLT) + + add sp, sp, #4 @ no need to restore r4 (we didn't touch it) + ldr pc, [sp], #20 @ return, discarding function arguments + + UNWIND .fnend @ end of unwinder entry + + .size privateSnippetExecutor, . - privateSnippetExecutor + .section .note.GNU-stack,"",%progbits diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s b/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s deleted file mode 100644 index 8fd1a38e4f51..000000000000 --- a/bridges/source/cpp_uno/gcc3_linux_arm/armhelper.s +++ /dev/null @@ -1,22 +0,0 @@ -@ ARM support code for OpenOffice C++/UNO bridging -@ -@ Written by Peter Naulls <peter@chocky.org> -@ Modified by Caolan McNamara <caolanm@redhat.com> - .file "armhelper.s" - .text - .align 4 - .global privateSnippetExecutor - .type privateSnippetExecutor, %function -privateSnippetExecutor: - stmfd sp!, {r0-r3} @ follow other parameters on stack - mov r0, ip @ r0 points to functionoffset/vtable - mov ip, sp @ fix up the ip - stmfd sp!, {fp,ip,lr,pc} @ 8 x 4 => stack remains 8 aligned - sub fp, ip, #4 @ set frame pointer - - add r1, sp, #16 @ r1 points to this and params - bl cpp_vtable_call(PLT) - - add sp, sp, #32 @ restore stack - ldr fp, [sp, #-32] @ restore frame pointer - ldr pc, [sp, #-24] @ return diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index 98c213a53a83..0e801ab4433e 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -76,10 +76,8 @@ namespace if (pReturnTypeDescr) { - if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) - { + if (!arm::return_in_hidden_param(pReturnTypeRef)) pUnoReturn = pRegisterReturn; // direct way for simple types - } else // complex return via ptr (pCppReturn) { pCppReturn = *(void **)pCppStack; @@ -410,8 +408,30 @@ extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset, void **pCallStack ) { sal_Int64 nRegReturn; - cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack, + typelib_TypeClass aType = cpp_mediate( pFunctionAndOffset[0], pFunctionAndOffset[1], pCallStack, &nRegReturn ); + + switch( aType ) + { + case typelib_TypeClass_BOOLEAN: + case typelib_TypeClass_BYTE: + nRegReturn = (unsigned long)(*(unsigned char *)&nRegReturn); + break; + case typelib_TypeClass_CHAR: + case typelib_TypeClass_UNSIGNED_SHORT: + case typelib_TypeClass_SHORT: + nRegReturn = (unsigned long)(*(unsigned short *)&nRegReturn); + break; + case typelib_TypeClass_ENUM: + case typelib_TypeClass_UNSIGNED_LONG: + case typelib_TypeClass_LONG: + nRegReturn = (unsigned long)(*(unsigned int *)&nRegReturn); + break; + case typelib_TypeClass_VOID: + default: + break; + } + return nRegReturn; } @@ -422,9 +442,9 @@ namespace const int codeSnippetSize = 20; unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, - sal_Int32 vtableOffset, bool simple_ret_type ) + sal_Int32 vtableOffset, bool bHasHiddenParam) { - if (!simple_ret_type) + if (bHasHiddenParam) functionIndex |= 0x80000000; unsigned long * p = (unsigned long *)code; @@ -478,24 +498,25 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( switch (member->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: + { + typelib_InterfaceAttributeTypeDescription *pAttrTD = + reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( member ); + // Getter: (s++)->fn = code + writetoexecdiff; code = codeSnippet( code, functionOffset++, vtableOffset, - bridges::cpp_uno::shared::isSimpleType( - reinterpret_cast< - typelib_InterfaceAttributeTypeDescription * >( - member)->pAttributeTypeRef)); + arm::return_in_hidden_param( pAttrTD->pAttributeTypeRef )); + // Setter: - if (!reinterpret_cast< - typelib_InterfaceAttributeTypeDescription * >( - member)->bReadOnly) + if (!pAttrTD->bReadOnly) { (s++)->fn = code + writetoexecdiff; code = codeSnippet( - code, functionOffset++, vtableOffset, true); + code, functionOffset++, vtableOffset, false); } break; + } case typelib_TypeClass_INTERFACE_METHOD: { (s++)->fn = code + writetoexecdiff; @@ -504,11 +525,8 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(member); - bool issimple = bridges::cpp_uno::shared::isSimpleType( - pMethodTD->pReturnTypeRef); - code = codeSnippet(code, functionOffset++, vtableOffset, - issimple); + arm::return_in_hidden_param(pMethodTD->pReturnTypeRef)); break; } default: diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx index df717fe1f279..ec1e671a72ba 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx @@ -162,8 +162,8 @@ namespace CPPU_CURRENT_NAMESPACE else { // try to lookup the symbol in the generated rtti map - t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) ); - if (iFind == m_generatedRttis.end()) + t_rtti_map::const_iterator iFind2( m_generatedRttis.find( unoName ) ); + if (iFind2 == m_generatedRttis.end()) { // we must generate it ! // symbol and rtti-name is nearly identical, @@ -192,7 +192,7 @@ namespace CPPU_CURRENT_NAMESPACE } else // taking already generated rtti { - rtti = iFind->second; + rtti = iFind2->second; } } } diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk index 44c557795510..0900ec11f41f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_linux_arm/makefile.mk @@ -80,5 +80,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk -$(SLO)$/%.obj: %.s +$(SLO)$/%.obj: %.S $(CXX) -c -o $(SLO)$/$(@:b).o $< -fPIC ; touch $@ diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx index cfe220abaf17..fb72c360fd45 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx @@ -89,5 +89,12 @@ namespace CPPU_CURRENT_NAMESPACE void fillUnoException( __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); } + +namespace arm +{ + enum armlimits { MAX_GPR_REGS = 4 }; + bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ); +} + #endif /* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index 154ae52027bb..be67ed8fd830 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -105,50 +105,94 @@ using namespace ::com::sun::star::uno; namespace arm { - enum armlimits { MAX_GPR_REGS = 4 }; + bool is_complex_struct(const typelib_TypeDescription * type) + { + const typelib_CompoundTypeDescription * p + = reinterpret_cast< const typelib_CompoundTypeDescription * >(type); + for (sal_Int32 i = 0; i < p->nMembers; ++i) + { + if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || + p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) + { + typelib_TypeDescription * t = 0; + TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); + bool b = is_complex_struct(t); + TYPELIB_DANGER_RELEASE(t); + if (b) { + return true; + } + } + else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) + return true; + } + if (p->pBaseTypeDescription != 0) + return is_complex_struct(&p->pBaseTypeDescription->aBase); + return false; + } + + bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) + { + if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) + return false; + else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) + { + typelib_TypeDescription * pTypeDescr = 0; + TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); + + //A Composite Type not larger than 4 bytes is returned in r0 + bool bRet = pTypeDescr->nSize > 4 || is_complex_struct(pTypeDescr); + + TYPELIB_DANGER_RELEASE( pTypeDescr ); + return bRet; + } + return true; + } } -void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn) +void MapReturn(sal_uInt32 r0, sal_uInt32 r1, typelib_TypeDescriptionReference * pReturnType, sal_uInt32* pRegisterReturn) { #if !defined(__ARM_EABI__) && !defined(__SOFTFP__) register float fret asm("f0"); register double dret asm("f0"); #endif - switch( eReturnType ) + switch( pReturnType->eTypeClass ) { case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: - ((long*)pRegisterReturn)[1] = r1; + pRegisterReturn[1] = r1; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_ENUM: - ((long*)pRegisterReturn)[0] = r0; - break; case typelib_TypeClass_CHAR: case typelib_TypeClass_SHORT: case typelib_TypeClass_UNSIGNED_SHORT: - *(unsigned short*)pRegisterReturn = (unsigned short)r0; - break; case typelib_TypeClass_BOOLEAN: case typelib_TypeClass_BYTE: - *(unsigned char*)pRegisterReturn = (unsigned char)r0; + pRegisterReturn[0] = r0; break; case typelib_TypeClass_FLOAT: #if defined(__ARM_EABI__) || defined(__SOFTFP__) - ((long*)pRegisterReturn)[0] = r0; + pRegisterReturn[0] = r0; #else *(float*)pRegisterReturn = fret; #endif break; case typelib_TypeClass_DOUBLE: #if defined(__ARM_EABI__) || defined(__SOFTFP__) - ((long*)pRegisterReturn)[1] = r1; - ((long*)pRegisterReturn)[0] = r0; + pRegisterReturn[1] = r1; + pRegisterReturn[0] = r0; #else *(double*)pRegisterReturn = dret; #endif break; + case typelib_TypeClass_STRUCT: + case typelib_TypeClass_EXCEPTION: + { + if (!arm::return_in_hidden_param(pReturnType)) + pRegisterReturn[0] = r0; + break; + } default: break; } @@ -162,7 +206,7 @@ void callVirtualMethod( void * pThis, sal_Int32 nVtableIndex, void * pRegisterReturn, - typelib_TypeClass eReturnType, + typelib_TypeDescriptionReference * pReturnType, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, @@ -172,7 +216,7 @@ void callVirtualMethod( void * pThis, sal_Int32 nVtableIndex, void * pRegisterReturn, - typelib_TypeClass eReturnType, + typelib_TypeDescriptionReference * pReturnType, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, @@ -201,23 +245,10 @@ void callVirtualMethod( typedef void (*FunctionCall )( sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32); FunctionCall pFunc = (FunctionCall)pMethod; - // fill registers - __asm__ __volatile__ ( - "ldr r0, [%0, #0]\n\t" - "ldr r1, [%0, #4]\n\t" - "ldr r2, [%0, #8]\n\t" - "ldr r3, [%0, #12]\n\t" - : : "r" (pGPR) - : "r0", "r1", "r2", "r3" - ); - - // tell gcc that r0 to r3 are not available to it - register sal_uInt32 r0 asm("r0"); - register sal_uInt32 r1 asm("r1"); - register sal_uInt32 r2 asm("r2"); - register sal_uInt32 r3 asm("r3"); - - (*pFunc)(r0, r1, r2, r3); + (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3]); + + sal_uInt32 r0; + sal_uInt32 r1; // get return value __asm__ __volatile__ ( @@ -225,7 +256,7 @@ void callVirtualMethod( "mov %1, r1\n\t" : "=r" (r0), "=r" (r1) : ); - MapReturn(r0, r1, eReturnType, pRegisterReturn); + MapReturn(r0, r1, pReturnType, (sal_uInt32*)pRegisterReturn); } } @@ -312,14 +343,14 @@ static void cpp_call( void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bOverFlow = false; - + bool bSimpleReturn = true; if (pReturnTypeDescr) { + if (arm::return_in_hidden_param( pReturnTypeRef ) ) + bSimpleReturn = false; - if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) - { + if (bSimpleReturn) pCppReturn = pUnoReturn; // direct way for simple types - } else { // complex return via ptr @@ -390,6 +421,8 @@ static void cpp_call( case typelib_TypeClass_DOUBLE: INSERT_DOUBLE( pCppArgs[nPos], nGPR, pGPR, pStack, pStackStart, bOverFlow ); break; + default: + break; } // no longer needed TYPELIB_DANGER_RELEASE( pParamTypeDescr ); @@ -431,7 +464,7 @@ static void cpp_call( { callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, - pCppReturn, pReturnTypeDescr->eTypeClass, + pCppReturn, pReturnTypeRef, pStackStart, (pStack - pStackStart), pGPR, nGPR); @@ -504,15 +537,19 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); +#if OSL_DEBUG_LEVEL > 0 typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; +#endif switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: { +#if OSL_DEBUG_LEVEL > 0 // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); +#endif VtableSlot aVtableSlot( getVtableSlot( @@ -557,9 +594,11 @@ void unoInterfaceProxyDispatch( } case typelib_TypeClass_INTERFACE_METHOD: { +#if OSL_DEBUG_LEVEL > 0 // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); +#endif VtableSlot aVtableSlot( getVtableSlot( diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index 8b37b633f59e..959452b4d985 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -61,7 +61,7 @@ namespace long r8, void ** gpreg, double *fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) { - void ** startovrflw; + void ** startovrflw = ovrflw; int nregs = 0; //number of words passed in registers #ifdef CMC_DEBUG @@ -143,7 +143,7 @@ namespace } else { - if ((startovrflw-ovrflw) & 4) + if ((startovrflw-ovrflw) & 1) ovrflw--; pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4); bOverFlowUsed = true; @@ -182,7 +182,7 @@ namespace } else { - if ((startovrflw-ovrflw) & 4) + if ((startovrflw-ovrflw) & 1) ovrflw--; pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4); bOverFlowUsed = true; diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk index 50cf80654a94..d5eb2dd6e1d9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_linux_intel/makefile.mk @@ -77,8 +77,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).o $< touch $@ diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk b/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk index 92d575a14dfb..7bca40bbaf97 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/makefile.mk @@ -72,8 +72,5 @@ SHL1STDLIBS= \ .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).o $< touch $@ diff --git a/bridges/source/cpp_uno/mingw_intel/makefile.mk b/bridges/source/cpp_uno/mingw_intel/makefile.mk index a23288f9f677..2c7a8da48527 100644 --- a/bridges/source/cpp_uno/mingw_intel/makefile.mk +++ b/bridges/source/cpp_uno/mingw_intel/makefile.mk @@ -87,8 +87,5 @@ DEF1NAME= $(SHL1TARGET) .INCLUDE : target.mk $(SLO)$/%.obj: %.s -#cmc: Ideally --noexecstack would be in operations, but with #i51385# pyuno -#remote bridgeing breaks -# $(CC) -Wa,--noexecstack -c -o $(SLO)$/$(@:b).o $< $(CC) -c -o $(SLO)$/$(@:b).obj $< touch $@ diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx index f0e338e4728c..ce58b1f3f779 100644 --- a/bridges/source/remote/urp/urp_job.hxx +++ b/bridges/source/remote/urp/urp_job.hxx @@ -76,9 +76,6 @@ public: ~Job(); - inline void setUnmarshal( Unmarshal *p ) - { m_pUnmarshal = p; } - public: remote_Context *m_pContext; Unmarshal *m_pUnmarshal; @@ -87,7 +84,7 @@ public: ::bridges_remote::RemoteThreadCounter m_counter; }; -class ClientJob : public Job +class ClientJob : private Job { public: // pContext is null for bridge-internal UrpProtocolProperties requests @@ -123,6 +120,9 @@ public: { return m_bBridgePropertyCall; } inline sal_Bool isOneway() { return m_bOneway; } + + inline void setUnmarshal( Unmarshal *p ) + { m_pUnmarshal = p; } public: typelib_InterfaceMethodTypeDescription *m_pMethodType; typelib_InterfaceAttributeTypeDescription *m_pAttributeType; @@ -172,7 +172,7 @@ struct ServerJobEntry sal_Bool m_bIgnoreCache; }; -class ServerMultiJob : public Job +class ServerMultiJob : private Job { public: ServerMultiJob( uno_Environment *pEnvRemote, diff --git a/idlc/source/preproc/cpp.h b/idlc/source/preproc/cpp.h index 24d30222b5a1..4b8645b2d34e 100644 --- a/idlc/source/preproc/cpp.h +++ b/idlc/source/preproc/cpp.h @@ -40,11 +40,8 @@ #define NULL 0 #endif -#ifndef __alpha typedef unsigned char uchar; -#endif - enum toktype { END, UNCLASS, NAME, NUMBER, STRING, CCON, NL, WS, DSHARP, diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx index 1647a1d9359b..3302fe42e90c 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx @@ -69,9 +69,11 @@ namespace jfw_plugin #define JFW_PLUGIN_ARCH "m68k" #elif defined HPPA #define JFW_PLUGIN_ARCH "parisc" -#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA +#elif defined AXP +#define JFW_PLUGIN_ARCH "alpha" +#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA #error unknown plattform -#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA +#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA, ALPHA class MalformedVersionException diff --git a/offapi/com/sun/star/accessibility/AccessibleRole.idl b/offapi/com/sun/star/accessibility/AccessibleRole.idl index 7231db672c07..5fe65d04ec42 100644 --- a/offapi/com/sun/star/accessibility/AccessibleRole.idl +++ b/offapi/com/sun/star/accessibility/AccessibleRole.idl @@ -686,6 +686,33 @@ published constants AccessibleRole @since OOo 3.0 */ const short TREE_TABLE = 80; + + /** Comment role + + <p>An object which represents a comment.</p> + + <p>A comment is anchored at a certain content position in the document and + annotates this document content position or a certain text range of the document content. + In the OpenDocument file format a comment is known as an annotation.</p> + + <p>See also <const>COMMENT_END</const>.</p> + + @since OOo 3.2 + */ + const short COMMENT = 81; + + /** Comment end role + + <p>An invisible object which represents the end position of a text range which + is annotated by a comment - see <const>COMMENT</const>.</p> + + <p>This object and the corresponding object representing the comment shall be + in relation of type <const>MEMBER_OF</const>.</p> + + @since OOo 3.2 + */ + const short COMMENT_END = 82; + }; }; }; }; }; diff --git a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl index 56f5305d10f2..db69a6b5d842 100644 --- a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl +++ b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl @@ -38,6 +38,7 @@ //============================================================================= /** If you do not want to implement the <type>XGridColumnModel</type> yourself, use this service. + @since OOo 3.3.0 */ service DefaultGridColumnModel { diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl index e823e451249c..c487afc79b49 100644 --- a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl @@ -38,6 +38,8 @@ //============================================================================= /** If you do not want to implement the <type>XGridDataModel</type> yourself, use this service. + + @since OOo 3.3.0 */ service DefaultGridDataModel { diff --git a/offapi/com/sun/star/awt/grid/GridColumn.idl b/offapi/com/sun/star/awt/grid/GridColumn.idl index a38d6cafd903..a87aef84f7d3 100644 --- a/offapi/com/sun/star/awt/grid/GridColumn.idl +++ b/offapi/com/sun/star/awt/grid/GridColumn.idl @@ -38,6 +38,8 @@ //============================================================================= /** Represents a column as used by the <type>DefaultGridColumnModel</type> + + @since OOo 3.3.0 */ service GridColumn { diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl index dfc6905d1148..caab721185a5 100644 --- a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl @@ -31,24 +31,14 @@ #include <com/sun/star/lang/EventObject.idl> #endif -#ifndef __com_sun_star_awt_grid_XGridColumn_idl__ -#include <com/sun/star/awt/grid/XGridColumn.idl> -#endif - //============================================================================= module com { module sun { module star { module awt { module grid { //============================================================================= +/** An event used by a <type>XGridColumn</type> to notify changes in the column. -/** An event used by a <type>XGridColumnModel</type> to notify changes in the column - model to the <type>XGridControl</type>. - You usually need to fill this event only if you implement the <type>XGridColumnModel</type> - yourself. - - @see XGridColumnModel - @see XGridControl - @see XGridColumnListener + @since OOo 3.3.0 */ struct GridColumnEvent: com::sun::star::lang::EventObject { @@ -63,9 +53,6 @@ struct GridColumnEvent: com::sun::star::lang::EventObject /** Contains the index of the changed column**/ long index; - - /** Contains the changed column**/ - XGridColumn column; //------------------------------------------------------------------------- }; diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl index 30d87a3f1c46..1e0afb610f16 100644 --- a/offapi/com/sun/star/awt/grid/GridDataEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl @@ -27,10 +27,7 @@ #ifndef __com_sun_star_awt_grid_GridDataEvent_idl__ #define __com_sun_star_awt_grid_GridDataEvent_idl__ -#ifndef __com_sun_star_lang_EventObject_idl__ #include <com/sun/star/lang/EventObject.idl> -#endif - //============================================================================= @@ -46,6 +43,8 @@ module com { module sun { module star { module awt { module grid { @see XGridDataModel @see XGridControl @see XGridDataListener + + @sonce OOo 3.3.0 */ struct GridDataEvent: com::sun::star::lang::EventObject { @@ -67,7 +66,7 @@ struct GridDataEvent: com::sun::star::lang::EventObject string headerName; /** Contains the changed row**/ - sequence<string> rowData; + sequence<any> rowData; }; diff --git a/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl new file mode 100644 index 000000000000..af1f90dfdc8b --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl @@ -0,0 +1,58 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: GridInvalidDataException.idl,v $ + * $Revision: 1.0 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_awt_grid_GridInvalidDataException_idl__ +#define __com_sun_star_awt_grid_GridInvalidDataException_idl__ + +#ifndef __com_sun_star_uno_RuntimeException_idl__ +#include <com/sun/star/uno/RuntimeException.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module awt { module grid { + +//============================================================================= + +/** Exception is thrown to indicate that set data is invalid, e.g. type of data is unknown + or data count doesn't match with column count. + + @since OOo 3.3.0 + */ +exception GridInvalidDataException : com::sun::star::uno::RuntimeException +{ + +}; + +//============================================================================= + +}; }; }; }; }; + +#endif diff --git a/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl new file mode 100644 index 000000000000..9d96daf624bb --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: GridInvalidModelException.idl,v $ + * $Revision: 1.0 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_awt_grid_GridInvalidModelException_idl__ +#define __com_sun_star_awt_grid_GridInvalidModelException_idl__ + +#ifndef __com_sun_star_uno_RuntimeException_idl__ +#include <com/sun/star/uno/RuntimeException.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module awt { module grid { + +//============================================================================= + +/** Exception is thrown when data or column model isn't set. + + @since OOo 3.3.0 + */ +exception GridInvalidModelException : com::sun::star::uno::RuntimeException +{ + +}; + +//============================================================================= + +}; }; }; }; }; + +#endif diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl index 2475e59b5b26..e9b87c2fe7ed 100644 --- a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl +++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl @@ -50,14 +50,17 @@ struct GridSelectionEvent: com::sun::star::lang::EventObject { //------------------------------------------------------------------------- - /** Contains the x coordinate of the selected cell**/ - long x; + /** the selected row*/ + long Row; - /** Contains the y coordinate of the selected cell**/ - long y; + /** the selected column*/ + long Column; + + /**number of selected rows, if multiple rows selected*/ + long Range; /** Contains the action <type>SelectionEventType</types> that was performed **/ - SelectionEventType action; + SelectionEventType Action; }; diff --git a/offapi/com/sun/star/awt/grid/SelectionEventType.idl b/offapi/com/sun/star/awt/grid/SelectionEventType.idl index 8096ceceeb13..c7ee61498cc3 100644 --- a/offapi/com/sun/star/awt/grid/SelectionEventType.idl +++ b/offapi/com/sun/star/awt/grid/SelectionEventType.idl @@ -49,7 +49,13 @@ enum SelectionEventType /** This value indicates that a selection was removed from the grid control */ - REMOVE + REMOVE, + + //------------------------------------------------------------------------- + + /** This value indicates that a selection was changed + */ + CHANGE }; diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl index 7de3eda02231..542c27085dcb 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl @@ -66,6 +66,7 @@ The <type>XGridSelection</type> interface provides a bunch of methods to set and get selection for the grid control. </p> + @since OOo 3.3.0 */ service UnoControlGrid { diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl index bcb28af294b8..7eea49624045 100644 --- a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl +++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl @@ -37,6 +37,12 @@ #include <com/sun/star/view/SelectionType.idl> +#include <com/sun/star/awt/FontDescriptor.idl> + +#include <com/sun/star/style/VerticalAlignment.idl> + +#include <com/sun/star/util/Color.idl> + //============================================================================= module com { module sun { module star { module awt { module grid { @@ -44,6 +50,8 @@ module com { module sun { module star { module awt { module grid { //============================================================================= /** specifies the standard model of a <type>UnoControlGridModel</type>. + + @since OOo 3.3.0 */ service UnoControlGridModel { @@ -84,11 +92,68 @@ service UnoControlGridModel */ [property] boolean VScroll; + /** Specifies that the control can be reached with the TAB key. + */ + [property] boolean Tabstop; + /** Specifies the selection mode that is enabled for this grid control. <p>The default value is <member scope="com::sun::star::view">SelectionType::SINGLE</member></p> */ [property] ::com::sun::star::view::SelectionType SelectionModel; + /** Specifies the background color of rows. If color for even rows is set, then specifies + the color of odd rows. Default value is white. + */ + [property] ::com::sun::star::util::Color RowBackgroundColor; + + /** Specifies the background color of even rows. Default value is white. + */ + [property] ::com::sun::star::util::Color EvenRowBackgroundColor; + + /** Specifies the background color of header. Default value is white. + */ + [property] ::com::sun::star::util::Color HeaderBackgroundColor; + + /** Specifies the text color. Default value is black. + */ + [property] ::com::sun::star::util::Color TextColor; + + /** Specifies the line color. Default value is white. + */ + [property] ::com::sun::star::util::Color LineColor; + + /** specifies the vertical alignment of the content in the control. + + <pre> + TOP + MIDDLE + BOTTOM + </pre> + */ + [property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the font attributes of the text in the control. + */ + [property] com::sun::star::awt::FontDescriptor FontDescriptor; + + /** specifies the <type scope="com::sun::star::text">FontEmphasis</type> + value of the text in the control. + */ + [property] short FontEmphasisMark; + + /** specifies the <type scope="com::sun::star::text">FontRelief</type> + value of the text in the control. + */ + [property] short FontRelief; + + /** specifies the help text of the control. + */ + [property] string HelpText; + + /** specifies the help URL of the control. + */ + [property] string HelpURL; + }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridCell.idl b/offapi/com/sun/star/awt/grid/XGridCell.idl index b64c40a3dce4..08f3cfd1b2d5 100644 --- a/offapi/com/sun/star/awt/grid/XGridCell.idl +++ b/offapi/com/sun/star/awt/grid/XGridCell.idl @@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -interface XGridCell: com::sun::star::uno::XInterface +interface XGridCell { [attribute] string Value; diff --git a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl index 825acd4af43a..7f9fa28c3307 100644 --- a/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl +++ b/offapi/com/sun/star/awt/grid/XGridCellRenderer.idl @@ -37,10 +37,9 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -/** gives access to the items of a list box and makes it possible to - register item and action event listeners. +/** renderer for cells */ -interface XGridCellRenderer: com::sun::star::uno::XInterface +interface XGridCellRenderer { //------------------------------------------------------------------------- diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl index 9c9981959ed3..d217ff5d4ac6 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumn.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl @@ -30,6 +30,9 @@ #ifndef __com_sun_star_uno_XInterface_idl__ #include <com/sun/star/uno/XInterface.idl> #endif +#include <com/sun/star/style/HorizontalAlignment.idl> +#include <com/sun/star/awt/grid/XGridColumnListener.idl> + //============================================================================= @@ -38,28 +41,67 @@ module com { module sun { module star { module awt { module grid { //============================================================================= /** The <type>XGridColumn</types> defines the properties and behavior of a column in a grid control + @since OOo 3.3.0 */ -interface XGridColumn: com::sun::star::uno::XInterface +interface XGridColumn { /** Specifies the an idendifier of the colomn.**/ [attribute] any Identifier; /** Specifies the default column witdth. **/ [attribute] long ColumnWidth; - /* + + /** Specifies the preferred column witdth. **/ [attribute] long PreferredWidth; + /** Specifies the min column witdth. **/ [attribute] long MinWidth; + /** Specifies the max column witdth. **/ [attribute] long MaxWidth; - [attribute] boolean Resizable; - */ + /** Specifies whether column has fixed size or not. **/ + [attribute] boolean Resizeable; + + /** Specifies the horizontal alignment of the content in the control. + + <pre> + LEFT + CENTER + RIGHT + </pre> + */ + [attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign; /** A title is displayed in the colum header row if <method>UnoControlGridModel::ShowRowHeader</method> is set to <true/>**/ [attribute] string Title; + /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes. + @param Listener + the listener to add. + */ + [oneway] void addColumnListener( [in] XGridColumnListener listener); + //------------------------------------------------------------------------- + + /** Removes a listener previously added with <method>addColumnListener()</method>. + @param Listener + the listener to remove. + */ + [oneway] void removeColumnListener( [in] XGridColumnListener listener); + + /**Updates changed column widths, when column widths are being resized. + @param name + can be PrefWidth or ColWidth, depending on which was changed + @param width + the new column width + */ + void updateColumn( [in] string name, [in] long width); + /**Sets column index + @param index + index, which is the index of the column in the column array of the column model + */ + void setIndex( [in] long index ); }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl index a9a0e50a34ed..8a2d044f33d5 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl @@ -46,18 +46,20 @@ module com { module sun { module star { module awt { module grid { <p>Usually you must not implement this interface yourself, but you must notify it correctly if you implement the <type>XGridColumnModel</type> yourself</p>. + + @since OOo 3.3.0 */ -interface XGridColumnListener: com::sun::star::uno::XInterface +interface XGridColumnListener { - /** - Invoked after a column was added to the column model. - */ - void columnAdded( [in] GridColumnEvent event ); - - /** - Invoked after a column was removed from the column model. - */ - void columnRemoved( [in] GridColumnEvent event ); + // /** + // Invoked after a column was added to the column model. + //*/ + //void columnAdded( [in] GridColumnEvent event ); + // + // /** + // Invoked after a column was removed from the column model. + //*/ + //void columnRemoved( [in] GridColumnEvent event ); /** Invoked after a column was modified. diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl index 51f290fcef0e..86e77680cd95 100644 --- a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl +++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl @@ -30,6 +30,7 @@ #include <com/sun/star/uno/XInterface.idl> #include <com/sun/star/awt/grid/XGridColumn.idl> + #include <com/sun/star/awt/grid/XGridColumnListener.idl> //============================================================================= @@ -42,12 +43,18 @@ module com { module sun { module star { module awt { module grid { retrieve the column structure that is displayed in the actual control. If you do not need your own model implementation, you can also use the <type>DefaultGridColumnModel</type>. + + @since OOo 3.3.0 */ -interface XGridColumnModel: com::sun::star::uno::XInterface +interface XGridColumnModel { - /** Specifies whether column selection is allowed + ///** Specifies whether column selection is allowed + //*/ + //[attribute] boolean ColumnSelectionAllowed; + + /**Specifies the height of column header. */ - [attribute] boolean ColumnSelectionAllowed; + [attribute] long ColumnHeaderHeight; /** Returns the number of columns. @returns @@ -81,29 +88,28 @@ interface XGridColumnModel: com::sun::star::uno::XInterface /** Returns a specific column. @param index - the position of the reuquested column. + the position of the requested column. @returns the requested column. */ XGridColumn getColumn( [in] long index); - /* - long getTotalColumnWidth(); + /** Sets default columns to the column model. + @param elements + the number of default columns that should be set. */ + void setDefaultColumns([in] long elements); - /** Adds a listener for the <type>GridColumnEvent</type> posted after the grid changes. - @param Listener - the listener to add. + /**Creates new XGridColumn with the settings of other column. To be used if the columns which are added to + the column model have the same settings. + @param column + the column, which is already created */ - [oneway] void addColumnListener( [in] XGridColumnListener listener); - - //------------------------------------------------------------------------- + XGridColumn copyColumn( [in] XGridColumn column ); - /** Removes a listener previously added with <method>addColumnListener()</method>. - @param Listener - the listener to remove. + /* + long getTotalColumnWidth(); */ - [oneway] void removeColumnListener( [in] XGridColumnListener listener); }; //============================================================================= diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl index 05c49aa1669d..5019a571663b 100644 --- a/offapi/com/sun/star/awt/grid/XGridControl.idl +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -41,30 +41,25 @@ module com { module sun { module star { module awt { module grid { /** An interface to a control that displays a tabular data. @see UnoControlGrid + + @since OOo 3.3.0 */ interface XGridControl: XGridSelection { - /** Specifies the <type>XGridColumnModel</type> of the control. - */ - [attribute] XGridColumnModel ColumnModel; - - /** Specifies the <type>XGridDataModel</type> of the control. - */ - [attribute] XGridDataModel DataModel; - - /** Converting */ long getItemIndexAtPoint( [in] long x, [in] long y); - /** registers a listener for mouse events. - */ - //[oneway] void addMouseListener( [in] com::sun::star::awt::XMouseListener listener ); - - /** unregisters a listener for mouse events. - */ - //[oneway] void removeMouseListener( [in] com::sun::star::awt::XMouseListener listener ); + /** Sets tooltip for row + @param textForTooltip + text, which will be shown as tooltip. + If only cell content should be displayed, leave sequence empty. + @param columnsForTooltip + column numbers, which define the cell content that should be shown in the tooltip. + If only text should be shown, leave this sequence empty. + */ + void setToolTip( [in] sequence< string > textForTooltip, [in] sequence< long > columnsForTooltip); }; diff --git a/offapi/com/sun/star/awt/grid/XGridControlListener.idl b/offapi/com/sun/star/awt/grid/XGridControlListener.idl index ac703e8516ee..6f4fdf68ccd4 100644 --- a/offapi/com/sun/star/awt/grid/XGridControlListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridControlListener.idl @@ -37,7 +37,7 @@ module com { module sun { module star { module awt { module grid { //============================================================================= -interface XGridControlListener: com::sun::star::uno::XInterface +interface XGridControlListener { }; diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl index cee808a178f2..d6d0d930b331 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataListener.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl @@ -46,6 +46,8 @@ module com { module sun { module star { module awt { module grid { <p>Usually you must not implement this interface yourself, but you must notify it correctly if you implement the <type>XGridDataModel</type> yourself</p>. + + @since OOo 3.3.0 */ interface XGridDataListener: com::sun::star::lang::XEventListener { diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl index f41841cf8039..5cc4085807e1 100644 --- a/offapi/com/sun/star/awt/grid/XGridDataModel.idl +++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl @@ -1,5 +1,6 @@ /************************************************************************* * + * $Revision: 1.8 $ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. @@ -41,6 +42,8 @@ module com { module sun { module star { module awt { module grid { retrieve the content data that is displayed in the actual control. If you do not need your own model implementation, you can also use the <type>DefaultGridDataModel</type>. + + @since OOo 3.3.0 */ interface XGridDataModel: ::com::sun::star::lang::XComponent { @@ -54,7 +57,11 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent /** Returns the content of each row. */ - [attribute,readonly] sequence< sequence< string > > Data; + [attribute,readonly] sequence< sequence< any > > Data; + + /**Specifies the width of row header. + */ + [attribute] long RowHeaderWidth; /** Returns the number of rows in in the model. @returns @@ -69,7 +76,7 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent @param data the content of the row. */ - void addRow( [in] string headername, [in] sequence< string > data ); + void addRow( [in] string headername, [in] sequence< any > data ); /** Removes a row from the model. @@ -82,6 +89,26 @@ interface XGridDataModel: ::com::sun::star::lang::XComponent */ void removeAll(); + /**Updates the content of a given cell. + @param row + the row index + @param column + the column index + @param value + the new value of the cell. + */ + void updateCell([in] long row, [in] long column, [in] any value ); + + /**Updates the content of a given row. + @param row + the row index + @param columns + column indexes of the cells, which should be updated + @param value + the new values of the cells. + */ + void updateRow([in] long row, [in] sequence< long > columns, [in] sequence< any > values); + //------------------------------------------------------------------------- /** Adds a listener for the <type>GridDataEvent</type> posted after the grid changes. diff --git a/offapi/com/sun/star/awt/grid/XGridSelection.idl b/offapi/com/sun/star/awt/grid/XGridSelection.idl index ecb760cb3277..5049426018b0 100644 --- a/offapi/com/sun/star/awt/grid/XGridSelection.idl +++ b/offapi/com/sun/star/awt/grid/XGridSelection.idl @@ -39,7 +39,7 @@ module com { module sun { module star { module awt { module grid { /** This interfaces provides access to the selection of row for <type>UnoControlGrid</type>. */ -interface XGridSelection: com::sun::star::uno::XInterface +interface XGridSelection { /** Returns the lowest index of the selection. @returns @@ -53,21 +53,25 @@ interface XGridSelection: com::sun::star::uno::XInterface */ long getMaxSelectionIndex(); - /** Adds a selection intervall. - @param start - the start row index. - @param length - the number of rows to be selected. + /** Selects all rows. */ - [oneway] void insertIndexIntervall( [in] long start, [in] long length); + [oneway] void selectAllRows(); - /** Removes a selection intervall. - @param start - the start row index. - @param length - the number of rows to be selected. + /** Selects multiple rows. Previous selections will be removed. + @param rangeOfRows + array of rows indexes, which will be selected. */ - [oneway] void removeIndexIntervall( [in] long start, [in] long length); + [oneway] void selectRows( [in] sequence< long > rangeOfRows); + + /** Deselects all selected rows. + */ + [oneway] void deselectAllRows(); + + /** Deselects selected rows. Selected rows, which aren't in the range remain selected. + @param rangeOfRows + array of rows indexes, which will be deselected. + */ + [oneway] void deselectRows( [in] sequence< long > rangeOfRows); /** Returns the indicies of all selected rows. @returns @@ -90,17 +94,17 @@ interface XGridSelection: com::sun::star::uno::XInterface boolean isSelectedIndex( [in] long index); /** Marks a row as selected. - @param + @param index the index of a row. */ - [oneway] void selectRow( [in] long y); + [oneway] void selectRow( [in] long index); /* [oneway] void selectColumn( [in] long x); */ /** Adds a listener for the <type>GridSelectionEvent</type> posted after the grid changes. - @param Listener + @param listener the listener to add. */ [oneway] void addSelectionListener( [in] XGridSelectionListener listener); @@ -108,7 +112,7 @@ interface XGridSelection: com::sun::star::uno::XInterface //------------------------------------------------------------------------- /** Removes a listener previously added with <method>addSelectionListener()</method>. - @param Listener + @param listener the listener to remove. */ [oneway] void removeSelectionListener( [in] XGridSelectionListener listener); diff --git a/offapi/com/sun/star/awt/grid/makefile.mk b/offapi/com/sun/star/awt/grid/makefile.mk index 3cfe6d83b3ba..02c159f8ffec 100644 --- a/offapi/com/sun/star/awt/grid/makefile.mk +++ b/offapi/com/sun/star/awt/grid/makefile.mk @@ -57,7 +57,9 @@ IDLFILES=\ ScrollBarMode.idl\ XGridControl.idl\ UnoControlGrid.idl\ - UnoControlGridModel.idl + UnoControlGridModel.idl\ + GridInvalidDataException.idl\ + GridInvalidModelException.idl # ------------------------------------------------------------------ .INCLUDE : target.mk diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl b/offapi/com/sun/star/document/MediaDescriptor.idl index 72690a45eccd..89a3141a443d 100644 --- a/offapi/com/sun/star/document/MediaDescriptor.idl +++ b/offapi/com/sun/star/document/MediaDescriptor.idl @@ -51,6 +51,10 @@ #include <com/sun/star/task/XStatusIndicator.idl> #endif +#ifndef __com_sun_star_frame_XFrame_idl__ +#include <com/sun/star/frame/XFrame.idl> +#endif + //============================================================================= module com { module sun { module star { module document { @@ -594,6 +598,11 @@ published service MediaDescriptor @since OOo 3.0 */ [optional,property] string ViewControllerName; + //------------------------------------------------------------------------- + + /** specifies the frame containing the document. May be empty. + */ + [optional,property] com::sun::star::frame::XFrame Frame; }; //============================================================================= diff --git a/offapi/com/sun/star/rdf/XDocumentRepository.idl b/offapi/com/sun/star/rdf/XDocumentRepository.idl index ee42faf0c51c..215fd89fa954 100644 --- a/offapi/com/sun/star/rdf/XDocumentRepository.idl +++ b/offapi/com/sun/star/rdf/XDocumentRepository.idl @@ -28,6 +28,10 @@ #ifndef __com_sun_star_rdf_XDocumentRepository_idl__ #define __com_sun_star_rdf_XDocumentRepository_idl__ +#ifndef __com_sun_star_beans_Pair_idl__ +#include <com/sun/star/beans/Pair.idl> +#endif + #ifndef __com_sun_star_rdf_XMetadatable_idl__ #include <com/sun/star/rdf/XMetadatable.idl> #endif @@ -84,13 +88,6 @@ interface XDocumentRepository : XRepository <code>Subject Predicate XLiteral(RDFaContent^^RDFaDatatype)</code> </li> </ul> - Further, add the following RDF statement to the same unspecified - named graph: - <ul> - <li> - <code>Subject rdfs:label XLiteral(Object->getText())</code> - </li> - </ul> </li> </ol> </p> @@ -172,13 +169,13 @@ interface XDocumentRepository : XRepository <li>if the element has no RDFa meta-data attributes: the empty sequence.</li> <li>if the element has RDFa meta-data attributes: - and no <code>rdfa:content</code> attached: - a sequence with the RDFa-statements corresponding to the - attributes</li> - <li>if the element has RDFa meta-data attributes, - and also <code>rdfa:content</code> attached: - a sequence with the RDFa-statements corresponding to the - attributes, including the RDFa-labels-statement</li> + <ul> + <li>a sequence with the RDFa-statements corresponding to the + attributes.</li> + <li>a flag indicating whether there is a xhtml:content + attribute.</li> + </ul> + </li> </ul> @throws com::sun::star::lang::IllegalArgumentException @@ -190,7 +187,8 @@ interface XDocumentRepository : XRepository @see Statement */ - sequence<Statement> getStatementRDFa([in] XMetadatable Element) + com::sun::star::beans::Pair< sequence<Statement>, boolean > + getStatementRDFa([in] XMetadatable Element) raises( com::sun::star::lang::IllegalArgumentException, RepositoryException ); diff --git a/offapi/com/sun/star/script/ModuleInfo.idl b/offapi/com/sun/star/script/ModuleInfo.idl new file mode 100644 index 000000000000..158ba387be6b --- /dev/null +++ b/offapi/com/sun/star/script/ModuleInfo.idl @@ -0,0 +1,55 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ModuleInfo.idl,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef __com_sun_star_script_ModuleInfo_idl__ +#define __com_sun_star_script_ModuleInfo_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= +module com { module sun { module star { module script { +struct ModuleInfo +{ + com::sun::star::uno::XInterface ModuleObject; + long ModuleType; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/script/ModuleType.idl b/offapi/com/sun/star/script/ModuleType.idl new file mode 100644 index 000000000000..a9bde042fa5a --- /dev/null +++ b/offapi/com/sun/star/script/ModuleType.idl @@ -0,0 +1,72 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ModuleType.idl,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: rt $ $Date: 2006/05/05 10:14:46 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef __com_sun_star_script_ModuleType_idl__ +#define __com_sun_star_script_ModuleType_idl__ + +//============================================================================= + +module com { module sun { module star { module script { + +published constants ModuleType +{ + // ------------------------------------------------------------------------ + + const long UNKNOWN = 0; + + // ------------------------------------------------------------------------ + + const long NORMAL = 1; + + // ------------------------------------------------------------------------ + + const long CLASS = 2; + + // ------------------------------------------------------------------------ + + const long FORM = 3; + + // ------------------------------------------------------------------------ + + const long DOCUMENT = 4; + + // ------------------------------------------------------------------------ +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/script/XVBACompat.idl b/offapi/com/sun/star/script/XVBACompat.idl new file mode 100644 index 000000000000..09da54eb27cd --- /dev/null +++ b/offapi/com/sun/star/script/XVBACompat.idl @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XLibraryContainer.idl,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_script_XVBACompat_idl__ +#define __com_sun_star_script_XVBACompat_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module script { + +interface XVBACompat: com::sun::star::uno::XInterface +{ + +//============================================================================= + [attribute ] boolean VBACompatModeOn; + +}; }; }; }; +}; +#endif diff --git a/offapi/com/sun/star/script/XVBAModuleInfo.idl b/offapi/com/sun/star/script/XVBAModuleInfo.idl new file mode 100644 index 000000000000..f9c4e64223c3 --- /dev/null +++ b/offapi/com/sun/star/script/XVBAModuleInfo.idl @@ -0,0 +1,73 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XLibraryContainer.idl,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_script_XVBACompat_idl__ +#define __com_sun_star_script_XVBACompat_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif +#ifndef __com_sun_star_script_ModuleInfo_idl__ +#include <com/sun/star/script/ModuleInfo.idl> +#endif +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif +#ifndef __com_sun_star_container_ElementExistException_idl__ +#include <com/sun/star/container/ElementExistException.idl> +#endif +#ifndef __com_sun_star_lang_WrappedTargetException_idl__ +#include <com/sun/star/lang/WrappedTargetException.idl> +#endif +#ifndef __com_sun_star_container_NoSuchElementException_idl__ +#include <com/sun/star/container/NoSuchElementException.idl> +#endif + +//============================================================================= + +module com { module sun { module star { module script { + +interface XVBAModuleInfo: com::sun::star::uno::XInterface +{ + + com::sun::star::script::ModuleInfo getModuleInfo( [in] string ModuleName ) + raises( com::sun::star::container::NoSuchElementException, + com::sun::star::lang::WrappedTargetException ); + boolean hasModuleInfo( [in] string ModuleName ); + void insertModuleInfo( [in] string ModuleName, + [in] com::sun::star::script::ModuleInfo ModuleInfo ) + raises( com::sun::star::lang::IllegalArgumentException, + com::sun::star::container::ElementExistException, + com::sun::star::lang::WrappedTargetException ); + void removeModuleInfo( [in] string ModuleName ) + raises( com::sun::star::container::NoSuchElementException, + com::sun::star::lang::WrappedTargetException ); +}; }; }; }; +}; +#endif diff --git a/offapi/com/sun/star/script/makefile.mk b/offapi/com/sun/star/script/makefile.mk index 579174390ec4..b694a753f7d7 100644 --- a/offapi/com/sun/star/script/makefile.mk +++ b/offapi/com/sun/star/script/makefile.mk @@ -48,6 +48,10 @@ IDLFILES=\ XPersistentLibraryContainer.idl\ XStorageBasedLibraryContainer.idl\ ModuleSizeExceededRequest.idl\ + XVBACompat.idl\ + XVBAModuleInfo.idl\ + ModuleInfo.idl\ + ModuleType.idl\ # ------------------------------------------------------------------ diff --git a/offapi/com/sun/star/text/InContentMetadata.idl b/offapi/com/sun/star/text/InContentMetadata.idl index f6aec7bbee63..5eac10714576 100755 --- a/offapi/com/sun/star/text/InContentMetadata.idl +++ b/offapi/com/sun/star/text/InContentMetadata.idl @@ -32,6 +32,10 @@ #include <com/sun/star/container/XEnumerationAccess.idl> #endif +#ifndef __com_sun_star_container_XChild_idl__ +#include <com/sun/star/container/XChild.idl> +#endif + #ifndef __com_sun_star_text_TextContent_idl__ #include <com/sun/star/text/TextContent.idl> #endif @@ -68,6 +72,12 @@ service InContentMetadata annotated range of text can be enumerated. */ interface com::sun::star::container::XEnumerationAccess; + //------------------------------------------------------------------------- + /** The <type>TextContent</type> that is the parent of this text range. + @since OOo 3.3 + */ + interface com::sun::star::container::XChild; + }; diff --git a/offapi/com/sun/star/text/TextMarkupType.idl b/offapi/com/sun/star/text/TextMarkupType.idl index d99942e0d12f..5137d47d217f 100644 --- a/offapi/com/sun/star/text/TextMarkupType.idl +++ b/offapi/com/sun/star/text/TextMarkupType.idl @@ -58,6 +58,12 @@ constants TextMarkupType /// An inivisible markup used to identify sentence boundaries. /// @since OOo 3.0.1 const long SENTENCE = 4; + + /// Markups originates from change tracking. + /// @since OOo 3.3 + const long TRACK_CHANGE_INSERTION = 5; + const long TRACK_CHANGE_DELETION = 6; + const long TRACK_CHANGE_FORMATCHANGE = 7; }; }; }; }; }; diff --git a/offapi/com/sun/star/text/TextRangeContentProperties.idl b/offapi/com/sun/star/text/TextRangeContentProperties.idl new file mode 100644 index 000000000000..74acb67cf9ed --- /dev/null +++ b/offapi/com/sun/star/text/TextRangeContentProperties.idl @@ -0,0 +1,133 @@ +/************************************************************************* + * + * 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 + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_text_TextRangeContentProperties_idl__ +#define __com_sun_star_text_TextRangeContentProperties_idl__ + +#ifndef __com_sun_star_table_XCell_idl__ +#include <com/sun/star/table/XCell.idl> +#endif + +#ifndef __com_sun_star_text_XTextContent_idl__ +#include <com/sun/star/text/XTextContent.idl> +#endif + +#ifndef __com_sun_star_text_XDocumentIndex_idl__ +#include <com/sun/star/text/XDocumentIndex.idl> +#endif + +#ifndef __com_sun_star_text_XTextTable_idl__ +#include <com/sun/star/text/XTextTable.idl> +#endif + +#ifndef __com_sun_star_text_XTextFrame_idl__ +#include <com/sun/star/text/XTextFrame.idl> +#endif + +#ifndef __com_sun_star_text_XTextSection_idl__ +#include <com/sun/star/text/XTextSection.idl> +#endif + +#ifndef __com_sun_star_text_XDocumentIndexMark_idl__ +#include <com/sun/star/text/XDocumentIndexMark.idl> +#endif + +#ifndef __com_sun_star_text_XFootnote_idl__ +#include <com/sun/star/text/XFootnote.idl> +#endif + + +//============================================================================= + +module com { module sun { module star { module text { + +//============================================================================= + +/** describes the structural properties to retrieve text contents. + + @since OOo 3.3 + */ +service TextRangeContentProperties +{ + //------------------------------------------------------------------------- + /** may contain a document index. */ + [optional, readonly, property] com::sun::star::text::XDocumentIndex + DocumentIndex; + + //------------------------------------------------------------------------- + /** may contain a text table. */ + [optional, readonly, property] com::sun::star::text::XTextTable + TextTable; + + //------------------------------------------------------------------------- + /** may contain a table cell. */ + [optional, readonly, property] com::sun::star::table::XCell Cell; + + //------------------------------------------------------------------------- + /** may contain a text frame. */ + [optional, readonly, property] com::sun::star::text::XTextFrame + TextFrame; + + //------------------------------------------------------------------------- + /** may contain a text section. */ + [optional, readonly, property] com::sun::star::text::XTextSection + TextSection; + + //------------------------------------------------------------------------- + /** may contain a document index mark. */ + [optional, readonly, property] com::sun::star::text::XDocumentIndexMark + DocumentIndexMark; + + //------------------------------------------------------------------------- + /** may contain a reference mark. */ + [optional, readonly, property] com::sun::star::text::XTextContent + ReferenceMark; + + //------------------------------------------------------------------------- + /** may contain a footnote. */ + [optional, readonly, property] com::sun::star::text::XFootnote Footnote; + + //------------------------------------------------------------------------- + /** may contain a endnote. */ + [optional, readonly, property] com::sun::star::text::XFootnote Endnote; + + //------------------------------------------------------------------------- + /** may contain a nested text content. + + For example, may contain an <type>InContentMetadata</type> or a + <type scope="com::sun::star::text::textfield">MetadataField</type>. + */ + [optional, readonly, property] com::sun::star::text::XTextContent + NestedTextContent; + +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/text/makefile.mk b/offapi/com/sun/star/text/makefile.mk index 28c3d1eaece3..4e6d24746af8 100644 --- a/offapi/com/sun/star/text/makefile.mk +++ b/offapi/com/sun/star/text/makefile.mk @@ -173,6 +173,7 @@ IDLFILES=\ TextPortionEnumeration.idl\ TextRange.idl\ TextRanges.idl\ + TextRangeContentProperties.idl\ TextSection.idl\ TextSections.idl\ TextSortable.idl\ diff --git a/offapi/com/sun/star/text/textfield/MetadataField.idl b/offapi/com/sun/star/text/textfield/MetadataField.idl index 85541457aef7..d98c4be39e96 100755 --- a/offapi/com/sun/star/text/textfield/MetadataField.idl +++ b/offapi/com/sun/star/text/textfield/MetadataField.idl @@ -32,6 +32,10 @@ #include <com/sun/star/container/XEnumerationAccess.idl> #endif +#ifndef __com_sun_star_container_XChild_idl__ +#include <com/sun/star/container/XChild.idl> +#endif + #ifndef __com_sun_star_text_TextField_idl__ #include <com/sun/star/text/TextField.idl> #endif @@ -79,6 +83,13 @@ service MetadataField interface com::sun::star::container::XEnumerationAccess; //------------------------------------------------------------------------- + /** The <type scope="com::sun::star::text">TextContent</type> + that is the parent of this <type>MetadataField</type>. + @since OOo 3.3 + */ + interface com::sun::star::container::XChild; + + //------------------------------------------------------------------------- /** this is the number format for this field. @see com::sun::star::util::NumberFormatter */ diff --git a/pyuno/zipcore/makefile.mk b/pyuno/zipcore/makefile.mk index 9e546e7d4018..06241da2bfdb 100755 --- a/pyuno/zipcore/makefile.mk +++ b/pyuno/zipcore/makefile.mk @@ -55,7 +55,7 @@ PYTHONBINARY=$(DESTROOT)$/bin$/python$(EXECPOST) .ENDIF FINDLIBFILES_TMP:=$(subst,/,$/ \ - $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v .pyc |$(GREP) -v .py\~ |$(GREP) -v .orig )) + $(shell @$(FIND) $(SOLARLIBDIR)$/python -type f| $(GREP) -v "\.pyc" |$(GREP) -v "\.py~" |$(GREP) -v .orig | $(GREP) -v _failed)) FINDLIBFILES=$(subst,$(SOLARLIBDIR)$/python, $(FINDLIBFILES_TMP)) FILES=\ diff --git a/sal/osl/unx/signal.c b/sal/osl/unx/signal.c index c5141fa02260..5563375d9567 100644 --- a/sal/osl/unx/signal.c +++ b/sal/osl/unx/signal.c @@ -74,10 +74,14 @@ #include "file_path_helper.h" #define ACT_IGNORE 1 -#define ACT_ABORT 2 -#define ACT_EXIT 3 -#define ACT_SYSTEM 4 -#define ACT_HIDE 5 +#define ACT_EXIT 2 +#define ACT_SYSTEM 3 +#define ACT_HIDE 4 +#ifdef SAL_ENABLE_CRASH_REPORT +# define ACT_ABORT 5 +#else +# define ACT_ABORT ACT_SYSTEM +#endif #define MAX_PATH_LEN 2048 @@ -556,7 +560,7 @@ static int ReportCrash( int Signal ) if (Signals[i].Signal == Signal && Signals[i].Action == ACT_ABORT ) { int ret; - char szShellCmd[512]; + char szShellCmd[512] = { '\0' }; char *pXMLTempName = NULL; char *pStackTempName = NULL; char *pChecksumTempName = NULL; @@ -728,68 +732,57 @@ static int ReportCrash( int Signal ) if ( checksumout ) fclose( checksumout ); -#if defined( LINUX ) - if ( pXMLTempName && pChecksumTempName && pStackTempName ) - snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "crash_report -p %d -s %d -xml %s -chksum %s -stack %s%s", - getpid(), - Signal, - pXMLTempName, - pChecksumTempName, - pStackTempName, - bAutoCrashReport ? " -noui -send" : " -noui" ); -#elif defined( MACOSX ) if ( pXMLTempName && pChecksumTempName && pStackTempName ) +#endif /* INCLUDE_BACKTRACE */ { - rtl_uString *crashrep_url = NULL; - rtl_uString *crashrep_path = NULL; - rtl_String *crashrep_path_system = NULL; - - rtl_string2UString( &crashrep_url, RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/program/crash_report.bin"), OSTRING_TO_OUSTRING_CVTFLAGS ); - rtl_bootstrap_expandMacros( &crashrep_url ); - osl_getSystemPathFromFileURL( crashrep_url, &crashrep_path ); + rtl_uString * crashrep_url = NULL; + rtl_uString * crashrep_path = NULL; + rtl_String * crashrep_path_system = NULL; + rtl_string2UString( + &crashrep_url, + RTL_CONSTASCII_USTRINGPARAM( + "$BRAND_BASE_DIR/program/crashrep"), + OSTRING_TO_OUSTRING_CVTFLAGS); + rtl_bootstrap_expandMacros(&crashrep_url); + osl_getSystemPathFromFileURL(crashrep_url, &crashrep_path); rtl_uString2String( &crashrep_path_system, - rtl_uString_getStr( crashrep_path ), - rtl_uString_getLength( crashrep_path ), + rtl_uString_getStr(crashrep_path), + rtl_uString_getLength(crashrep_path), osl_getThreadTextEncoding(), - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR ); - - rtl_uString_release( crashrep_url ); - rtl_uString_release( crashrep_path ); - + (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR + | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)); + rtl_uString_release(crashrep_url); + rtl_uString_release(crashrep_path); +#if defined INCLUDE_BACKTRACE && (defined LINUX || defined MACOSX) snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "%s -p %d -s %d -xml %s -chksum %s -stack %s%s", - rtl_string_getStr( crashrep_path_system ), + "%s -p %d -s %d -xml %s -chksum %s -stack %s -noui%s", + rtl_string_getStr(crashrep_path_system), getpid(), Signal, pXMLTempName, pChecksumTempName, pStackTempName, - bAutoCrashReport ? " -noui -send" : " -noui" ); - - rtl_string_release( crashrep_path_system ); - - printf( "%s\n", szShellCmd ); - } -#elif defined ( SOLARIS ) - if ( pXMLTempName && pChecksumTempName ) + bAutoCrashReport ? " -send" : "" ); +#elif defined INCLUDE_BACKTRACE && defined SOLARIS snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "crash_report -p %d -s %d -xml %s -chksum %s%s", + "%s -p %d -s %d -xml %s -chksum %s -noui%s", + rtl_string_getStr(crashrep_path_system), getpid(), Signal, pXMLTempName, pChecksumTempName, - bAutoCrashReport ? " -noui -send" : " -noui" ); + bAutoCrashReport ? " -send" : "" ); +#else + snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), + "%s -p %d -s %d -noui%s", + rtl_string_getStr(crashrep_path_system), + getpid(), Signal, bAutoCrashReport ? " -send" : "" ); #endif + rtl_string_release(crashrep_path_system); + } -#else /* defined INCLUDE BACKTRACE */ - snprintf( szShellCmd, sizeof(szShellCmd)/sizeof(szShellCmd[0]), - "crash_report -p %d -s %d%s", getpid(), Signal, bAutoCrashReport ? " -noui -send" : " -noui" ); -#endif /* defined INCLUDE BACKTRACE */ - - - ret = system( szShellCmd ); + ret = szShellCmd[0] == '\0' ? -1 : system( szShellCmd ); if ( pXMLTempName ) unlink( pXMLTempName ); diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx index a48918668f83..50f0d7de924e 100644 --- a/sal/rtl/source/macro.hxx +++ b/sal/rtl/source/macro.hxx @@ -89,6 +89,8 @@ this is inserted for the case that the preprocessor ignores error # define THIS_ARCH "M68K" #elif defined HPPA # define THIS_ARCH "HPPA" +#elif defined AXP +# define THIS_ARCH "ALPHA" #endif #if ! defined THIS_ARCH diff --git a/sal/typesconfig/typesconfig.c b/sal/typesconfig/typesconfig.c index 8223c80a5856..708837be926b 100644 --- a/sal/typesconfig/typesconfig.c +++ b/sal/typesconfig/typesconfig.c @@ -160,7 +160,7 @@ int check( TestFunc func, Type eT, void* p ) |* Letzte Aenderung |* *************************************************************************/ -#if defined(IA64) || defined(ARM32) || defined(HPPA) +#if defined(IA64) || defined(ARM32) || defined(HPPA) || defined(AXP) int forceerror() { diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx index ec325ce11db1..95d9990257f5 100644 --- a/stoc/source/corereflection/criface.cxx +++ b/stoc/source/corereflection/criface.cxx @@ -877,7 +877,8 @@ sal_Bool InterfaceIdlClassImpl::isAssignableFrom( const Reference< XIdlClass > & Uik InterfaceIdlClassImpl::getUik() throw(::com::sun::star::uno::RuntimeException) { - return *(Uik *)&getTypeDescr()->aUik; + return Uik(0, 0, 0, 0, 0); + // Uiks are deprecated and this function must not be called } //__________________________________________________________________________________________________ Sequence< Reference< XIdlMethod > > InterfaceIdlClassImpl::getMethods() |