summaryrefslogtreecommitdiff
path: root/cppu/source/typelib/static_types.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/typelib/static_types.cxx')
-rw-r--r--cppu/source/typelib/static_types.cxx72
1 files changed, 0 insertions, 72 deletions
diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index f0787c19ae5c..c1221e4e84a3 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -671,78 +671,6 @@ void SAL_CALL typelib_static_array_type_init(
}
}
-//##################################################################################################
-void SAL_CALL typelib_static_union_type_init(
- typelib_TypeDescriptionReference ** ppRef,
- const sal_Char * pTypeName,
- typelib_TypeDescriptionReference * pDiscriminantTypeRef,
- sal_Int64 nDefaultDiscriminant,
- typelib_TypeDescriptionReference * pDefaultTypeRef,
- sal_Int32 nMembers,
- sal_Int64 * pDiscriminants,
- typelib_TypeDescriptionReference ** pMemberTypes )
- SAL_THROW_EXTERN_C()
-{
- if (! *ppRef)
- {
- MutexGuard aGuard( typelib_StaticInitMutex::get() );
- if (! *ppRef)
- {
- OSL_ASSERT( ! TYPELIB_TYPEDESCRIPTIONREFERENCE_ISREALLYWEAK(typelib_TypeClass_UNION) );
- OUString aTypeName( OUString::createFromAscii( pTypeName ) );
- *ppRef = igetTypeByName( aTypeName.pData );
- if (!*ppRef)
- {
- typelib_UnionTypeDescription * pUnion = 0;
- ::typelib_typedescription_newEmpty(
- (typelib_TypeDescription **)&pUnion, typelib_TypeClass_UNION, aTypeName.pData );
- // discriminant type
- ::typelib_typedescriptionreference_acquire( pUnion->pDiscriminantTypeRef = pDiscriminantTypeRef );
-
- sal_Int32 nPos;
-
- pUnion->nMembers = nMembers;
- // default discriminant
- if (nMembers)
- {
- pUnion->pDiscriminants = new sal_Int64[ nMembers ];
- for ( nPos = nMembers; nPos--; )
- {
- pUnion->pDiscriminants[nPos] = pDiscriminants[nPos];
- }
- }
- // default default discriminant
- pUnion->nDefaultDiscriminant = nDefaultDiscriminant;
-
- // union member types
- pUnion->ppTypeRefs = new typelib_TypeDescriptionReference *[ nMembers ];
- for ( nPos = nMembers; nPos--; )
- {
- ::typelib_typedescriptionreference_acquire(
- pUnion->ppTypeRefs[nPos] = pMemberTypes[nPos] );
- }
-
- // default union type
- ::typelib_typedescriptionreference_acquire( pUnion->pDefaultTypeRef = pDefaultTypeRef );
-
- typelib_TypeDescription * pReg = (typelib_TypeDescription *)pUnion;
-
- pReg->pWeakRef = (typelib_TypeDescriptionReference *)pReg;
- pReg->nSize = typelib_typedescription_getAlignedUnoSize( pReg, 0, pReg->nAlignment );
- pReg->nAlignment = adjustAlignment( pReg->nAlignment );
- pReg->bComplete = sal_False;
-
- ::typelib_typedescription_register( &pReg );
- *ppRef = (typelib_TypeDescriptionReference *)pReg;
- OSL_ASSERT( *ppRef == pReg->pWeakRef );
- }
-#ifndef CPPU_LEAK_STATIC_DATA
- // another static ref
- ++((*ppRef)->nStaticRefCount);
-#endif
- }
- }
-}
} // extern "C"
}