diff options
author | Matthew Pottage <matthewpottage@invincitech.com> | 2014-08-06 08:32:04 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-08-08 11:25:55 +0200 |
commit | 03e0bd6b3b4314e2476030da7ddc71cf30f8b2e9 (patch) | |
tree | 61badfbc4196eca0d0cb4f1c7337592e02b17082 /cppuhelper | |
parent | 024e53766c53916290dcfba08c5e9020a1325cd5 (diff) |
[API CHANGE] Removed two cppuhelper deprecated headers.
The headers cppuheader/compbase.hxx and implbase.hxx. They have been deprecated
since 2001. Moved the definitions of the deprecated functions to
cppuhelper/source/compat.cxx.
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, adding fixes and clean-up
in cppuhelper/source/compat.cxx and odk/Package_odk_headers.mk
Change-Id: I48b3cbf551b59d72614737a883a96aab55fc2090
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/compat.cxx | 56 | ||||
-rw-r--r-- | cppuhelper/source/implbase.cxx | 144 |
2 files changed, 57 insertions, 143 deletions
diff --git a/cppuhelper/source/compat.cxx b/cppuhelper/source/compat.cxx index 2141f8b763eb..092e2449fbd2 100644 --- a/cppuhelper/source/compat.cxx +++ b/cppuhelper/source/compat.cxx @@ -32,6 +32,7 @@ namespace com { namespace sun { namespace star { namespace lang { class XMultiComponentFactory; class XMultiServiceFactory; + class XTypeProvider; } namespace reflection { class XIdlClass; } namespace registry { @@ -112,6 +113,61 @@ loadSharedLibComponentFactory( for (;;) { std::abort(); } // avoid "must return a value" warnings } +struct SAL_DLLPUBLIC_EXPORT ClassData { + css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId(); + + css::uno::Sequence<css::uno::Type> SAL_CALL getTypes(); + + void SAL_CALL initTypeProvider(); + + css::uno::Any SAL_CALL query( + css::uno::Type const &, css::lang::XTypeProvider *); + + void SAL_CALL writeTypeOffset(css::uno::Type const &, sal_Int32); +}; + +css::uno::Sequence<sal_Int8> ClassData::getImplementationId() { + for (;;) { std::abort(); } // avoid "must return a value" warnings +} + +css::uno::Sequence<css::uno::Type> ClassData::getTypes() { + for (;;) { std::abort(); } // avoid "must return a value" warnings +} + +void ClassData::initTypeProvider() { + std::abort(); +} + +css::uno::Any ClassData::query( + css::uno::Type const &, css::lang::XTypeProvider *) +{ + for (;;) { std::abort(); } // avoid "must return a value" warnings +} + +void ClassData::writeTypeOffset(css::uno::Type const &, sal_Int32) { + std::abort(); +} + +struct SAL_DLLPUBLIC_EXPORT ClassDataBase { + ClassDataBase(); + + ClassDataBase(sal_Int32); + + ~ClassDataBase(); +}; + +ClassDataBase::ClassDataBase() { + std::abort(); +} + +ClassDataBase::ClassDataBase(sal_Int32) { + std::abort(); +} + +ClassDataBase::~ClassDataBase() { + std::abort(); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index 1ffb856a9bb3..aa75e9e4e788 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <cppuhelper/implbase.hxx> -#include <cppuhelper/compbase.hxx> +#include <cppuhelper/compbase_ex.hxx> #include <osl/diagnose.h> #include <rtl/instance.hxx> #include <rtl/string.hxx> @@ -36,147 +35,6 @@ using rtl::OString; namespace cppu { -// ClassDataBase - -ClassDataBase::ClassDataBase() - : bOffsetsInit( sal_False ) - , nType2Offset( 0 ) - , nClassCode( 0 ) - , pTypes( 0 ) - , pId( 0 ) -{ -} - -ClassDataBase::ClassDataBase( sal_Int32 nClassCode_ ) - : bOffsetsInit( sal_False ) - , nType2Offset( 0 ) - , nClassCode( nClassCode_ ) - , pTypes( 0 ) - , pId( 0 ) -{ -} - -ClassDataBase::~ClassDataBase() -{ - delete pTypes; - delete pId; - - for ( sal_Int32 nPos = nType2Offset; nPos--; ) - { - typelib_typedescription_release( - (typelib_TypeDescription *)((ClassData *)this)->arType2Offset[nPos].pTD ); - } -} - -// ClassData - -void ClassData::writeTypeOffset( const Type & rType, sal_Int32 nOffset ) -{ - arType2Offset[nType2Offset].nOffset = nOffset; - - arType2Offset[nType2Offset].pTD = 0; - typelib_typedescriptionreference_getDescription( - (typelib_TypeDescription **)&arType2Offset[nType2Offset].pTD, rType.getTypeLibType() ); - - if (arType2Offset[nType2Offset].pTD) - ++nType2Offset; -#if OSL_DEBUG_LEVEL > 1 - else - { - OString msg( "### cannot get type description for " ); - msg += OUStringToOString( rType.getTypeName(), RTL_TEXTENCODING_ASCII_US ); - OSL_FAIL( msg.getStr() ); - } -#endif -} - -void ClassData::initTypeProvider() -{ - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if (! pTypes) - { - // collect types - Sequence< Type > * types = new Sequence< Type >( - nType2Offset + 1 + (nClassCode == 4 ? 2 : nClassCode) ); - Type * pTypeAr = types->getArray(); - - // given types - sal_Int32 nPos = nType2Offset; - while (nPos--) - pTypeAr[nPos] = ((typelib_TypeDescription *)arType2Offset[nPos].pTD)->pWeakRef; - - // XTypeProvider - pTypeAr[nType2Offset] = ::getCppuType( (const Reference< lang::XTypeProvider > *)0 ); - - // class code extra types: [[XComponent,] XWeak[, XAggregation]] - switch (nClassCode) - { - case 4: - pTypeAr[nType2Offset +2] = ::getCppuType( (const Reference< lang::XComponent > *)0 ); - pTypeAr[nType2Offset +1] = ::getCppuType( (const Reference< XWeak > *)0 ); - break; - case 3: - pTypeAr[nType2Offset +3] = ::getCppuType( (const Reference< lang::XComponent > *)0 ); - case 2: - pTypeAr[nType2Offset +2] = ::getCppuType( (const Reference< XAggregation > *)0 ); - case 1: - pTypeAr[nType2Offset +1] = ::getCppuType( (const Reference< XWeak > *)0 ); - } - - pTypes = types; - } -} - -Sequence< Type > ClassData::getTypes() -{ - if (! pTypes) - initTypeProvider(); - return *pTypes; -} - -Sequence< sal_Int8 > ClassData::getImplementationId() -{ - return css::uno::Sequence<sal_Int8>(); -} - - -static inline bool td_equals( - typelib_TypeDescription * pTD, typelib_TypeDescriptionReference * pType ) -{ - return (pTD->pWeakRef == pType || - (pTD->pTypeName->length == pType->pTypeName->length && - rtl_ustr_compare( pTD->pTypeName->buffer, pType->pTypeName->buffer ) == 0)); -} - -Any ClassData::query( const Type & rType, lang::XTypeProvider * pBase ) -{ - if (rType == ::getCppuType( (const Reference< XInterface > *)0 )) - return Any( &pBase, ::getCppuType( (const Reference< XInterface > *)0 ) ); - for ( sal_Int32 nPos = 0; nPos < nType2Offset; ++nPos ) - { - const Type_Offset & rTO = arType2Offset[nPos]; - typelib_InterfaceTypeDescription * pTD = rTO.pTD; - while (pTD) - { - if (td_equals( (typelib_TypeDescription *)pTD, - *(typelib_TypeDescriptionReference **)&rType )) - { - void * pInterface = (char *)pBase + rTO.nOffset; - return Any( &pInterface, (typelib_TypeDescription *)pTD ); - } - pTD = pTD->pBaseTypeDescription; - } - } - if (rType == ::getCppuType( (const Reference< lang::XTypeProvider > *)0 )) - return Any( &pBase, ::getCppuType( (const Reference< lang::XTypeProvider > *)0 ) ); - - return Any(); -} - - - - - // WeakComponentImplHelperBase WeakComponentImplHelperBase::WeakComponentImplHelperBase( Mutex & rMutex ) |