summaryrefslogtreecommitdiffstats
path: root/cppu/source/typelib/typelib.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/typelib/typelib.cxx')
-rw-r--r--cppu/source/typelib/typelib.cxx93
1 files changed, 42 insertions, 51 deletions
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 52d1a2e09e68..f869e795c077 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -1489,11 +1489,8 @@ extern "C" void SAL_CALL typelib_typedescription_register(
::typelib_typedescriptionreference_release( pTDR );
return;
}
- else
- {
- // destruction of this type in progress (another thread!)
- (void)osl_atomic_decrement( &pTDR->pType->nRefCount );
- }
+ // destruction of this type in progress (another thread!)
+ (void)osl_atomic_decrement( &pTDR->pType->nRefCount );
}
// take new descr
pTDR->pType = *ppNewDescription;
@@ -2205,13 +2202,10 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_getDescription(
*ppRet = pRef->pType;
return;
}
- else
- {
- (void)osl_atomic_decrement( &pRef->pType->nRefCount );
- // destruction of this type in progress (another thread!)
- // no access through this weak reference
- pRef->pType = nullptr;
- }
+ (void)osl_atomic_decrement( &pRef->pType->nRefCount );
+ // destruction of this type in progress (another thread!)
+ // no access through this weak reference
+ pRef->pType = nullptr;
}
}
@@ -2339,51 +2333,48 @@ extern "C" sal_Bool SAL_CALL typelib_typedescriptionreference_isAssignableFrom(
{
return true;
}
- else
+ switch (eAssignable)
{
- switch (eAssignable)
- {
- case typelib_TypeClass_STRUCT:
- case typelib_TypeClass_EXCEPTION:
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ {
+ typelib_TypeDescription * pFromDescr = nullptr;
+ TYPELIB_DANGER_GET( &pFromDescr, pFrom );
+ if (!reinterpret_cast<typelib_CompoundTypeDescription *>(pFromDescr)->pBaseTypeDescription)
{
- typelib_TypeDescription * pFromDescr = nullptr;
- TYPELIB_DANGER_GET( &pFromDescr, pFrom );
- if (!reinterpret_cast<typelib_CompoundTypeDescription *>(pFromDescr)->pBaseTypeDescription)
- {
- TYPELIB_DANGER_RELEASE( pFromDescr );
- return false;
- }
- bool bRet = typelib_typedescriptionreference_isAssignableFrom(
- pAssignable,
- reinterpret_cast<typelib_CompoundTypeDescription *>(pFromDescr)->pBaseTypeDescription->aBase.pWeakRef );
TYPELIB_DANGER_RELEASE( pFromDescr );
- return bRet;
- }
- case typelib_TypeClass_INTERFACE:
- {
- typelib_TypeDescription * pFromDescr = nullptr;
- TYPELIB_DANGER_GET( &pFromDescr, pFrom );
- typelib_InterfaceTypeDescription * pFromIfc
- = reinterpret_cast<
- typelib_InterfaceTypeDescription * >(pFromDescr);
- bool bRet = false;
- for (sal_Int32 i = 0; i < pFromIfc->nBaseTypes; ++i) {
- if (typelib_typedescriptionreference_isAssignableFrom(
- pAssignable,
- pFromIfc->ppBaseTypes[i]->aBase.pWeakRef))
- {
- bRet = true;
- break;
- }
- }
- TYPELIB_DANGER_RELEASE( pFromDescr );
- return bRet;
- }
- default:
- {
return false;
}
+ bool bRet = typelib_typedescriptionreference_isAssignableFrom(
+ pAssignable,
+ reinterpret_cast<typelib_CompoundTypeDescription *>(pFromDescr)->pBaseTypeDescription->aBase.pWeakRef );
+ TYPELIB_DANGER_RELEASE( pFromDescr );
+ return bRet;
+ }
+ case typelib_TypeClass_INTERFACE:
+ {
+ typelib_TypeDescription * pFromDescr = nullptr;
+ TYPELIB_DANGER_GET( &pFromDescr, pFrom );
+ typelib_InterfaceTypeDescription * pFromIfc
+ = reinterpret_cast<
+ typelib_InterfaceTypeDescription * >(pFromDescr);
+ bool bRet = false;
+ for (sal_Int32 i = 0; i < pFromIfc->nBaseTypes; ++i) {
+ if (typelib_typedescriptionreference_isAssignableFrom(
+ pAssignable,
+ pFromIfc->ppBaseTypes[i]->aBase.pWeakRef))
+ {
+ bRet = true;
+ break;
+ }
}
+ TYPELIB_DANGER_RELEASE( pFromDescr );
+ return bRet;
+ }
+ default:
+ {
+ return false;
+ }
}
}
return (eAssignable >= typelib_TypeClass_CHAR && eAssignable <= typelib_TypeClass_DOUBLE &&