summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-10-01 09:04:58 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-10-01 09:04:58 +0000
commit3b2b8f91ff22b93050b9b1aa3da5bd4359182499 (patch)
tree3e37aa664496da562640735b168da4dcc08bb737 /cppu
parent257b3205cae2665a96492b806df10faf884a4e99 (diff)
CWS-TOOLING: integrate CWS sb93
Diffstat (limited to 'cppu')
-rw-r--r--cppu/qa/makefile.mk14
-rw-r--r--cppu/qa/types.idl4
-rw-r--r--cppu/source/typelib/typelib.cxx28
3 files changed, 34 insertions, 12 deletions
diff --git a/cppu/qa/makefile.mk b/cppu/qa/makefile.mk
index c0a1f1df0542..4051dd6d82ec 100644
--- a/cppu/qa/makefile.mk
+++ b/cppu/qa/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.6 $
+# $Revision: 1.6.14.1 $
#
# This file is part of OpenOffice.org.
#
@@ -62,7 +62,14 @@ SHL3VERSIONMAP = version.map
SHL3IMPLIB = i$(SHL3TARGET)
DEF3NAME = $(SHL3TARGET)
-SLOFILES = $(SHL1OBJS) $(SHL2OBJS) $(SHL3OBJS)
+SHL4TARGET = $(TARGET)_recursion
+SHL4OBJS = $(SLO)$/test_recursion.obj
+SHL4STDLIBS = $(CPPULIB) $(CPPUNITLIB) $(SALLIB)
+SHL4VERSIONMAP = version.map
+SHL4IMPLIB = i$(SHL4TARGET)
+DEF4NAME = $(SHL4TARGET)
+
+SLOFILES = $(SHL1OBJS) $(SHL2OBJS) $(SHL3OBJS) $(SHL4OBJS)
.INCLUDE: target.mk
@@ -84,7 +91,8 @@ $(MISC)$/$(TARGET)$/types.urd: types.idl
- $(MKDIR) $(MISC)$/$(TARGET)
$(IDLC) -O$(MISC)$/$(TARGET) -I$(SOLARIDLDIR) -cid -we $<
-test .PHONY: $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN)
+test .PHONY: $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN) $(SHL4TARGETN)
testshl2 $(SHL1TARGETN)
testshl2 $(SHL2TARGETN)
testshl2 $(SHL3TARGETN)
+ testshl2 $(SHL4TARGETN) \ No newline at end of file
diff --git a/cppu/qa/types.idl b/cppu/qa/types.idl
index 8df58e68ad48..1d62b5c33b26 100644
--- a/cppu/qa/types.idl
+++ b/cppu/qa/types.idl
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: types.idl,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.14.1 $
*
* This file is part of OpenOffice.org.
*
@@ -45,6 +45,8 @@ struct Struct2b: Struct2a { long member3; };
struct Poly< T > { long member; };
+struct Rec { sequence< Rec > x; };
+
exception Exception1: com::sun::star::uno::Exception { long member; };
exception Exception2: com::sun::star::uno::Exception { long member; };
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index dd2de4e59bc9..a27b29d1ddbe 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: typelib.cxx,v $
- * $Revision: 1.35 $
+ * $Revision: 1.35.6.1 $
*
* This file is part of OpenOffice.org.
*
@@ -875,13 +875,25 @@ void newTypeDescription(
= pStructMembers[i].aBase.pMemberName );
}
// write offset
- typelib_TypeDescription * pTD = 0;
- TYPELIB_DANGER_GET( &pTD, pTmp->ppTypeRefs[i] );
- OSL_ENSURE( pTD->nSize, "### void member?" );
- nOffset = newAlignedSize(
- nOffset, pTD->nSize, pTD->nAlignment );
- pTmp->pMemberOffsets[i] = nOffset - pTD->nSize;
- TYPELIB_DANGER_RELEASE( pTD );
+ sal_Int32 size;
+ sal_Int32 alignment;
+ if (pTmp->ppTypeRefs[i]->eTypeClass ==
+ typelib_TypeClass_SEQUENCE)
+ {
+ // Take care of recursion like
+ // struct S { sequence<S> x; };
+ size = sizeof(void *);
+ alignment = adjustAlignment(size);
+ } else {
+ typelib_TypeDescription * pTD = 0;
+ TYPELIB_DANGER_GET( &pTD, pTmp->ppTypeRefs[i] );
+ OSL_ENSURE( pTD->nSize, "### void member?" );
+ size = pTD->nSize;
+ alignment = pTD->nAlignment;
+ TYPELIB_DANGER_RELEASE( pTD );
+ }
+ nOffset = newAlignedSize( nOffset, size, alignment );
+ pTmp->pMemberOffsets[i] = nOffset - size;
if (polymorphic) {
reinterpret_cast< typelib_StructTypeDescription * >(