From 045e99596c4aef353b73980d85b57731f9d9088a Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Tue, 30 Mar 2004 15:45:53 +0000 Subject: INTEGRATION: CWS sb14 (1.7.4); FILE MERGED 2004/03/01 12:59:24 sb 1.7.4.1: #i21150# Added optional interface inheritance; added -stdin switch; do not warn about bad member names of com.sun.star.uno.Uik; some general clean up and added const qualifiers. --- idlc/source/astscope.cxx | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'idlc/source/astscope.cxx') diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index 23d45ac15468..244be71a3515 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -2,9 +2,9 @@ * * $RCSfile: astscope.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: hr $ $Date: 2004-02-03 11:58:49 $ + * last change: $Author: rt $ $Date: 2004-03-30 16:45:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,8 +142,8 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl) sal_uInt16 AstScope::getNodeCount(NodeType nodeType) { - DeclList::iterator iter = getIteratorBegin(); - DeclList::iterator end = getIteratorEnd(); + DeclList::const_iterator iter = getIteratorBegin(); + DeclList::const_iterator end = getIteratorEnd(); AstDeclaration* pDecl = NULL; sal_uInt16 count = 0; @@ -252,10 +252,10 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName) return pDecl; } -AstDeclaration* AstScope::lookupByNameLocal(const OString& name) +AstDeclaration* AstScope::lookupByNameLocal(const OString& name) const { - DeclList::iterator iter = getIteratorBegin(); - DeclList::iterator end = getIteratorEnd(); + DeclList::const_iterator iter(m_declarations.begin()); + DeclList::const_iterator end(m_declarations.end()); AstDeclaration* pDecl = NULL; while ( iter != end ) @@ -268,7 +268,7 @@ AstDeclaration* AstScope::lookupByNameLocal(const OString& name) return NULL; } -AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) +AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) const { AstDeclaration* pDecl = NULL; AstInterface* pInterface = (AstInterface*)this; @@ -283,19 +283,17 @@ AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) } // OK, loop through inherited interfaces. Stop when you find it - if ( pInterface->nInheritedInterfaces() > 0 ) + AstInterface::InheritedInterfaces::const_iterator iter( + pInterface->getAllInheritedInterfaces().begin()); + AstInterface::InheritedInterfaces::const_iterator end( + pInterface->getAllInheritedInterfaces().end()); + while ( iter != end ) { - DeclList::const_iterator iter = pInterface->getInheritedInterfaces().begin(); - DeclList::const_iterator end = pInterface->getInheritedInterfaces().end(); - - while ( iter != end ) - { - if ( pDecl = ((AstInterface*)(*iter))->lookupByNameLocal(scopedName) ) - return pDecl; - if ( pDecl = ((AstInterface*)(*iter))->lookupInInherited(scopedName) ) - return pDecl; - ++iter; - } + if ( pDecl = iter->getInterface()->lookupByNameLocal(scopedName) ) + return pDecl; + if ( pDecl = iter->getInterface()->lookupInInherited(scopedName) ) + return pDecl; + ++iter; } // Not found return NULL; -- cgit