diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-06-03 14:10:36 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-06-03 14:10:36 +0000 |
commit | d1ba9e18f8d474a12199f974c47ac26e83c762fb (patch) | |
tree | 45334f9cc740475555bf2de5ec8d6c5a093d74dc /idlc/source/idlc.cxx | |
parent | c95fdf355a3057405430009af95620ba8640c511 (diff) |
INTEGRATION: CWS sb18 (1.4.4); FILE MERGED
2004/04/08 14:37:17 sb 1.4.4.1: #i21150# Fixed UNOIDL typedef support; initial support for polymorphic struct types.
Diffstat (limited to 'idlc/source/idlc.cxx')
-rw-r--r-- | idlc/source/idlc.cxx | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/idlc/source/idlc.cxx b/idlc/source/idlc.cxx index cd7c5156e738..20075dea7993 100644 --- a/idlc/source/idlc.cxx +++ b/idlc/source/idlc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: idlc.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2004-03-30 16:47:07 $ + * last change: $Author: obo $ $Date: 2004-06-03 15:10:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,6 +99,8 @@ #include "idlc/asttype.hxx" #include "idlc/asttypedef.hxx" +#include "osl/diagnose.h" + using namespace ::rtl; AstDeclaration* SAL_CALL scopeAsDecl(AstScope* pScope) @@ -301,37 +303,17 @@ Idlc* SAL_CALL setIdlc(Options* pOptions) return pStaticIdlc; } -sal_Bool SAL_CALL canBeRedefined(AstDeclaration *pDecl) -{ - switch (pDecl->getNodeType()) - { - case NT_module: - case NT_constants: - case NT_interface: - case NT_const: - case NT_exception: - case NT_parameter: - case NT_enum_val: - case NT_array: - case NT_sequence: - case NT_union: - case NT_struct: - case NT_enum: - case NT_typedef: -// return sal_True; - case NT_union_branch: - case NT_member: - case NT_attribute: - case NT_operation: - case NT_predefined: - default: - return sal_False; +AstDeclaration const * resolveTypedefs(AstDeclaration const * type) { + if (type != 0) { + while (type->getNodeType() == NT_typedef) { + type = static_cast< AstTypeDef const * >(type)->getBaseType(); + } } + return type; } -AstType const * resolveTypedefs(AstType const * type) { - while (type->getNodeType() == NT_typedef) { - type = static_cast< AstTypeDef const * >(type)->getBaseType(); - } - return type; +AstInterface const * resolveInterfaceTypedefs(AstType const * type) { + AstDeclaration const * decl = resolveTypedefs(type); + OSL_ASSERT(decl->getNodeType() == NT_interface); + return static_cast< AstInterface const * >(decl); } |