summaryrefslogtreecommitdiffstats
path: root/idlc/source/fehelper.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-02-03 10:59:47 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-02-03 10:59:47 +0000
commit35f5a869cac3c5f4c5fb20cd59d569e72045e41b (patch)
treeb1ae557c5f3fd2560ad8898af60e854f91de9758 /idlc/source/fehelper.cxx
parentINTEGRATION: CWS sb10 (1.6.20); FILE MERGED (diff)
downloadcore-35f5a869cac3c5f4c5fb20cd59d569e72045e41b.tar.gz
core-35f5a869cac3c5f4c5fb20cd59d569e72045e41b.zip
INTEGRATION: CWS sb10 (1.3.74); FILE MERGED
2003/12/10 09:12:20 sb 1.3.74.1: #114000# Adapted to multiple-inheritance interface types.
Diffstat (limited to 'idlc/source/fehelper.cxx')
-rw-r--r--idlc/source/fehelper.cxx59
1 files changed, 17 insertions, 42 deletions
diff --git a/idlc/source/fehelper.cxx b/idlc/source/fehelper.cxx
index 3b5d301fa4a5..c4dbf151766d 100644
--- a/idlc/source/fehelper.cxx
+++ b/idlc/source/fehelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fehelper.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: pl $ $Date: 2001-05-10 13:07:49 $
+ * last change: $Author: hr $ $Date: 2004-02-03 11:59:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -131,7 +131,7 @@ AstType* FeDeclarator::compose(AstDeclaration* pDecl)
return NULL; // return through this statement should not happen
}
-FeInheritanceHeader::FeInheritanceHeader(NodeType nodeType, ::rtl::OString* pName, StringList* pInherits)
+FeInheritanceHeader::FeInheritanceHeader(NodeType nodeType, ::rtl::OString* pName, ::rtl::OString* pInherits)
: m_nodeType(nodeType)
, m_pName(pName)
, m_pInherits(NULL)
@@ -139,54 +139,29 @@ FeInheritanceHeader::FeInheritanceHeader(NodeType nodeType, ::rtl::OString* pNam
initializeInherits(pInherits);
}
-sal_Bool FeInheritanceHeader::initializeInherits(StringList* pInherits)
+void FeInheritanceHeader::initializeInherits(::rtl::OString* pInherits)
{
- if ( pInherits && (pInherits->size() > 0) )
+ if ( pInherits )
{
- StringList::iterator iter = pInherits->begin();
- StringList::iterator end = pInherits->end();
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstDeclaration* pDecl = NULL;
-
- m_pInherits = new DeclList();
- while (pScope && iter != end)
+ AstDeclaration* pDecl = pScope->lookupByName(*pInherits);
+ if ( pDecl )
{
- pDecl = pScope->lookupByName(*iter);
- if ( pDecl )
+ if ( pDecl->getNodeType() == getNodeType()
+ && (pDecl->getNodeType() != NT_interface
+ || static_cast< AstInterface* >(pDecl)->isDefined()) )
{
- m_pInherits->push_back(pDecl);
- } else
+ m_pInherits = pDecl;
+ }
+ else
{
- idlc()->error()->lookupError(*iter);
- return sal_False;
+ idlc()->error()->inheritanceError(
+ getNodeType(), getName(), pDecl);
}
- ++iter;
}
- }
- return sal_True;
-}
-
-sal_Bool FeInterfaceHeader::initializeInherits(StringList* pInherits)
-{
- if ( !pInherits )
- return sal_True;
-
- if ( !FeInheritanceHeader::initializeInherits(pInherits) )
- return sal_False;
-
- DeclList::iterator iter = m_pInherits->begin();
- DeclList::iterator end = m_pInherits->end();
-
- while ( iter != end )
- {
- AstInterface* pIface = ((AstInterface*)*iter);
- if ( ((*iter)->getNodeType() != NT_interface) ||
- !((AstInterface*)*iter)->isDefined() )
+ else
{
- idlc()->error()->inheritanceError(getName(), *iter);
- return sal_False;
+ idlc()->error()->lookupError(*pInherits);
}
- ++iter;
}
- return sal_True;
}