summaryrefslogtreecommitdiff
path: root/cppu/source/typelib/static_types.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-06-04 02:19:00 +0000
committerOliver Bolte <obo@openoffice.org>2004-06-04 02:19:00 +0000
commit106fae0b164fb12df048a6e48eb61ff71396e2ed (patch)
tree135e5534f8b687b234cd35e68b5be329c3169bde /cppu/source/typelib/static_types.cxx
parentddc9e2c129ad8cfc5b3c41f4719420710b8d3060 (diff)
INTEGRATION: CWS sb18 (1.10.20); FILE MERGED
2004/05/13 14:16:37 sb 1.10.20.1: #i21150# New functionality in cppu/typedescription.h for polymorphic struct types.
Diffstat (limited to 'cppu/source/typelib/static_types.cxx')
-rw-r--r--cppu/source/typelib/static_types.cxx47
1 files changed, 42 insertions, 5 deletions
diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index e1505890390c..e584be2d27d9 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: static_types.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: hr $ $Date: 2004-02-03 12:16:57 $
+ * last change: $Author: obo $ $Date: 2004-06-04 03:19:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -415,12 +415,14 @@ void SAL_CALL typelib_static_sequence_type_init(
}
//##################################################################################################
-void SAL_CALL typelib_static_compound_type_init(
+namespace {
+
+void init(
typelib_TypeDescriptionReference ** ppRef,
typelib_TypeClass eTypeClass, const sal_Char * pTypeName,
typelib_TypeDescriptionReference * pBaseType,
- sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers )
- SAL_THROW_EXTERN_C()
+ sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers,
+ sal_Bool * pParameterizedTypes)
{
OSL_ENSURE( typelib_TypeClass_STRUCT == eTypeClass ||
typelib_TypeClass_EXCEPTION == eTypeClass, "### unexpected type class!" );
@@ -453,6 +455,11 @@ void SAL_CALL typelib_static_compound_type_init(
pComp->nMembers = nMembers;
pComp->pMemberOffsets = new sal_Int32[ nMembers ];
pComp->ppTypeRefs = new typelib_TypeDescriptionReference *[ nMembers ];
+ if (pParameterizedTypes != 0) {
+ reinterpret_cast< typelib_StructTypeDescription * >(
+ pComp)->pParameterizedTypes
+ = new sal_Bool[nMembers];
+ }
for ( sal_Int32 i = 0 ; i < nMembers; ++i )
{
::typelib_typedescriptionreference_acquire(
@@ -464,6 +471,12 @@ void SAL_CALL typelib_static_compound_type_init(
nOffset = newAlignedSize( nOffset, pTD->nSize, pTD->nAlignment );
pComp->pMemberOffsets[i] = nOffset - pTD->nSize;
TYPELIB_DANGER_RELEASE( pTD );
+
+ if (pParameterizedTypes != 0) {
+ reinterpret_cast< typelib_StructTypeDescription * >(
+ pComp)->pParameterizedTypes[i]
+ = pParameterizedTypes[i];
+ }
}
}
@@ -486,6 +499,30 @@ void SAL_CALL typelib_static_compound_type_init(
}
}
+}
+
+void SAL_CALL typelib_static_compound_type_init(
+ typelib_TypeDescriptionReference ** ppRef,
+ typelib_TypeClass eTypeClass, const sal_Char * pTypeName,
+ typelib_TypeDescriptionReference * pBaseType,
+ sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers )
+ SAL_THROW_EXTERN_C()
+{
+ init(ppRef, eTypeClass, pTypeName, pBaseType, nMembers, ppMembers, 0);
+}
+
+void SAL_CALL typelib_static_struct_type_init(
+ typelib_TypeDescriptionReference ** ppRef, const sal_Char * pTypeName,
+ typelib_TypeDescriptionReference * pBaseType,
+ sal_Int32 nMembers, typelib_TypeDescriptionReference ** ppMembers,
+ sal_Bool * pParameterizedTypes )
+ SAL_THROW_EXTERN_C()
+{
+ init(
+ ppRef, typelib_TypeClass_STRUCT, pTypeName, pBaseType, nMembers,
+ ppMembers, pParameterizedTypes);
+}
+
//##################################################################################################
void SAL_CALL typelib_static_interface_type_init(
typelib_TypeDescriptionReference ** ppRef,