From 1de12cd29aa72999f64bc93647a2406c6e765a5c Mon Sep 17 00:00:00 2001 From: albert-github Date: Wed, 13 Feb 2019 14:34:22 +0100 Subject: Bug 399222 - SORT_BRIEF_DOCS produces wrong results Grouped brief (with `\{ ..\}` descriptions were not sorted when `SORT_BRIEF_DOCS` was set, the detailed documentation was sorted already. --- src/filedef.cpp | 12 ++++++++++++ src/membergroup.cpp | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/filedef.cpp b/src/filedef.cpp index f9f68d1..187b665 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -1966,6 +1966,18 @@ void FileDef::sortMemberLists() { if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); } } + + if (m_memberGroupSDict) + { + MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); + MemberGroup *mg; + for (;(mg=mgli.current());++mgli) + { + MemberList *mlg = mg->members(); + if (mlg->needsSorting()) { mlg->sort(); mlg->setNeedsSorting(FALSE); } + } + } + } MemberList *FileDef::getMemberList(MemberListType lt) const diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 5ee47ab..840c62b 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -44,8 +44,11 @@ MemberGroup::MemberGroup() MemberGroup::MemberGroup(Definition *parent, int id,const char *hdr,const char *d,const char *docFile,int docLine) { + static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); + //printf("New member group id=%d header=%s desc=%s\n",id,hdr,d); memberList = new MemberList(MemberListType_memberGroup); + memberList->setNeedsSorting(sortBriefDocs); // detailed sections are already sorted elsewhere. grpId = id; grpHeader = hdr; doc = d; -- cgit v0.12 it/Doxygen.git/stats/src?h=Release_1_8_15'>stats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2013-12-30 17:55:14 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2013-12-30 17:55:14 (GMT)
commit6e51abf63021dc9fe32c05f003232fe68a08591d (patch)
treee9fe6f526e4a2b22b1a55659331c15750969a019 /src
parent744d1ca52e25dfa9e3d656056d87ed7cb6320585 (diff)
downloadDoxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.zip
Doxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.tar.gz
Doxygen-6e51abf63021dc9fe32c05f003232fe68a08591d.tar.bz2
Reduced and improved functionality of QList
- operations on current index and node (next(), prev(), last(), first()) have been removed. - access to internal nodes has been removed. - old QList has been renamed to QInternalList for use inside qtools only. - added type safe compare, new, and delete operations (compareValues(), newValue(), deleteValue()). - add compareValues also to QDict for consistency. - changed doxygen's implementation to comply with the new QList and QDict interface.
Diffstat (limited to 'src')
-rw-r--r--src/cite.cpp2
-rw-r--r--src/classdef.cpp64
-rw-r--r--src/classdef.h10
-rw-r--r--src/classlist.cpp14
-rw-r--r--src/classlist.h16
-rw-r--r--src/code.l25
-rw-r--r--src/config.l28
-rw-r--r--src/dbusxmlscanner.cpp24
-rw-r--r--src/define.h19
-rw-r--r--src/definition.cpp8
-rw-r--r--src/definition.h6
-rw-r--r--src/diagram.cpp180
-rw-r--r--src/dirdef.cpp16
-rw-r--r--src/dirdef.h13
-rw-r--r--src/docparser.cpp46
-rw-r--r--src/dot.cpp9
-rw-r--r--src/doxygen.cpp206
-rw-r--r--src/doxygen.h1
-rw-r--r--src/example.h5
-rw-r--r--src/filedef.cpp19
-rw-r--r--src/filedef.h11
-rw-r--r--src/filename.cpp46
-rw-r--r--src/filename.h7
-rw-r--r--src/fortrancode.l10
-rw-r--r--src/fortranscanner.l4
-rw-r--r--src/ftvhelp.cpp7
-rw-r--r--src/groupdef.cpp38
-rw-r--r--src/groupdef.h9
-rw-r--r--src/htmlattrib.h22
-rw-r--r--src/htmlhelp.cpp5
-rw-r--r--src/index.cpp248
-rw-r--r--src/latexgen.cpp24
-rw-r--r--src/memberdef.cpp38
-rw-r--r--src/membergroup.cpp17
-rw-r--r--src/membergroup.h5
-rw-r--r--src/memberlist.cpp14
-rw-r--r--src/memberlist.h5
-rw-r--r--src/membername.cpp16
-rw-r--r--src/membername.h20
-rw-r--r--src/namespacedef.cpp13
-rw-r--r--src/namespacedef.h19
-rw-r--r--src/outputlist.cpp148
-rw-r--r--src/outputlist.h26
-rw-r--r--src/pagedef.h5
-rw-r--r--src/perlmodgen.cpp2
-rw-r--r--src/reflist.h5
-rw-r--r--src/rtfgen.cpp24
-rw-r--r--src/scanner.l14
-rw-r--r--src/searchindex.cpp14
-rw-r--r--src/settings.h2
-rw-r--r--src/sortdict.h18
-rw-r--r--src/tagreader.cpp83
-rw-r--r--src/template.cpp8
-rw-r--r--src/util.cpp61
-rw-r--r--src/util.h11
-rw-r--r--src/vhdlcode.l8
-rw-r--r--src/vhdldocgen.cpp22
-rw-r--r--src/vhdlparser.y2
-rw-r--r--src/vhdlscanner.l2
59 files changed, 849 insertions, 895 deletions
diff --git a/src/cite.cpp b/src/cite.cpp
index 3e3eb43..53ab9b5 100644
--- a/src/cite.cpp
+++ b/src/cite.cpp
@@ -310,7 +310,7 @@ void CiteDict::generatePage() const
thisDir.remove(bib2xhtmlFile);
while (!tempFiles.isEmpty())
{
- QCString *s=tempFiles.take();
+ QCString *s=tempFiles.take(0);
thisDir.remove(*s);
}
}
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 7e8b331..b8501ad 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -897,8 +897,9 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
for (spi.toFirst();(al=spi.current());++spi)
{
ol.docify("template<");
- Argument *a=al->first();
- while (a)
+ QListIterator<Argument> ali(*al);
+ Argument *a;
+ while ((a=ali.current()))
{
ol.docify(a->type);
if (!a->name.isEmpty())
@@ -911,7 +912,8 @@ static void writeTemplateSpec(OutputList &ol,Definition *d,
ol.docify(" = ");
ol.docify(a->defval);
}
- a=al->next();
+ ++ali;
+ a=ali.current();
if (a) ol.docify(", ");
}
ol.docify(">");
@@ -1084,8 +1086,9 @@ void ClassDef::showUsedFiles(OutputList &ol)
ol.parseText(generatedFromFiles());
bool first=TRUE;
- FileDef *fd = m_impl->files.first();
- while (fd)
+ QListIterator<FileDef> li(m_impl->files);
+ FileDef *fd;
+ for (;(fd=li.current());++li)
{
if (first)
{
@@ -1139,8 +1142,6 @@ void ClassDef::showUsedFiles(OutputList &ol)
ol.popGeneratorState();
ol.endItemListItem();
-
- fd=m_impl->files.next();
}
if (!first) ol.endItemList();
@@ -1153,22 +1154,20 @@ int ClassDef::countInheritanceNodes()
BaseClassDef *ibcd;
if (m_impl->inheritedBy)
{
- ibcd=m_impl->inheritedBy->first();
- while (ibcd)
+ BaseClassListIterator it(*m_impl->inheritedBy);
+ for (;(ibcd=it.current());++it)
{
ClassDef *icd=ibcd->classDef;
if ( icd->isVisibleInHierarchy()) count++;
- ibcd=m_impl->inheritedBy->next();
}
}
if (m_impl->inherits)
{
- ibcd=m_impl->inherits->first();
- while (ibcd)
+ BaseClassListIterator it(*m_impl->inherits);
+ for (;(ibcd=it.current());++it)
{
ClassDef *icd=ibcd->classDef;
if ( icd->isVisibleInHierarchy()) count++;
- ibcd=m_impl->inherits->next();
}
}
return count;
@@ -2228,8 +2227,9 @@ void ClassDef::writeMemberList(OutputList &ol)
MemberNameInfo *mni;
for (mnii.toFirst();(mni=mnii.current());++mnii)
{
- MemberInfo *mi=mni->first();
- while (mi)
+ MemberNameInfoIterator it(*mni);
+ MemberInfo *mi;
+ for (;(mi=it.current());++it)
{
MemberDef *md=mi->memberDef;
ClassDef *cd=md->getClassDef();
@@ -2425,7 +2425,6 @@ void ClassDef::writeMemberList(OutputList &ol)
ol.writeString("</tr>\n");
}
}
- mi=mni->next();
}
}
//ol.endItemList();
@@ -3732,7 +3731,7 @@ void ClassDef::getTemplateParameterLists(QList<ArgumentList> &lists) const
}
QCString ClassDef::qualifiedNameWithTemplateParameters(
- QList<ArgumentList> *actualParams) const
+ QList<ArgumentList> *actualParams,int *actualParamIndex) const
{
//static bool optimizeOutputJava = Config_getBool("OPTIMIZE_OUTPUT_JAVA");
static bool hideScopeNames = Config_getBool("HIDE_SCOPE_NAMES");
@@ -3744,7 +3743,7 @@ QCString ClassDef::qualifiedNameWithTemplateParameters(
if (d->definitionType()==Definition::TypeClass)
{
ClassDef *cd=(ClassDef *)d;
- scName = cd->qualifiedNameWithTemplateParameters(actualParams);
+ scName = cd->qualifiedNameWithTemplateParameters(actualParams,actualParamIndex);
}
else if (!hideScopeNames)
{
@@ -3769,13 +3768,14 @@ QCString ClassDef::qualifiedNameWithTemplateParameters(
ArgumentList *al=0;
if (templateArguments())
{
- if (actualParams && (al=actualParams->current()))
+ if (actualParams && *actualParamIndex<(int)actualParams->count())
{
+ al = actualParams->at(*actualParamIndex);
if (!isSpecialization)
{
scName+=tempArgListToString(al);
}
- actualParams->next();
+ (*actualParamIndex)++;
}
else
{
@@ -3897,14 +3897,14 @@ MemberList *ClassDef::createMemberList(MemberListType lt)
MemberList *ClassDef::getMemberList(MemberListType lt)
{
- MemberList *ml = m_impl->memberLists.first();
- while (ml)
+ QListIterator<MemberList> mli(m_impl->memberLists);
+ MemberList *ml;
+ for (;(ml=mli.current());++mli)
{
if (ml->listType()==lt)
{
return ml;
}
- ml = m_impl->memberLists.next();
}
return 0;
}
@@ -3923,11 +3923,11 @@ void ClassDef::addMemberToList(MemberListType lt,MemberDef *md,bool isBrief)
void ClassDef::sortMemberLists()
{
- MemberList *ml = m_impl->memberLists.first();
- while (ml)
+ QListIterator<MemberList> mli(m_impl->memberLists);
+ MemberList *ml;
+ for (;(ml=mli.current());++mli)
{
if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
- ml = m_impl->memberLists.next();
}
}
@@ -4441,11 +4441,11 @@ MemberDef *ClassDef::isSmartPointer() const
void ClassDef::reclassifyMember(MemberDef *md,MemberType t)
{
md->setMemberType(t);
- MemberList *ml = m_impl->memberLists.first();
- while (ml)
+ QListIterator<MemberList> mli(m_impl->memberLists);
+ MemberList *ml;
+ for (;(ml=mli.current());++mli)
{
ml->remove(md);
- ml = m_impl->memberLists.next();
}
insertMember(md);
}
@@ -4530,11 +4530,11 @@ void ClassDef::setTagLessReference(ClassDef *cd)
void ClassDef::removeMemberFromLists(MemberDef *md)
{
- MemberList *ml = m_impl->memberLists.first();
- while (ml)
+ QListIterator<MemberList> mli(m_impl->memberLists);
+ MemberList *ml;
+ for (;(ml=mli.current());++mli)
{
ml->remove(md);
- ml = m_impl->memberLists.next();
}
}
diff --git a/src/classdef.h b/src/classdef.h
index 6ce1e73..35c093c 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -246,7 +246,7 @@ class ClassDef : public Definition
void getTemplateParameterLists(QList<ArgumentList> &lists) const;
QCString qualifiedNameWithTemplateParameters(
- QList<ArgumentList> *actualParams=0) const;
+ QList<ArgumentList> *actualParams=0,int *actualParamIndex=0) const;
/** Returns TRUE if there is at least one pure virtual member in this
* class.
@@ -532,11 +532,11 @@ class BaseClassList : public QList<BaseClassDef>
{
public:
~BaseClassList() {}
- int compareItems(QCollection::Item item1,QCollection::Item item2)
+ int compareValues(const BaseClassDef *item1,const BaseClassDef *item2) const
{
- ClassDef *c1=((BaseClassDef *)item1)->classDef;
- ClassDef *c2=((BaseClassDef *)item2)->classDef;
- if (c1==0 || c2==0)
+ const ClassDef *c1=item1->classDef;
+ const ClassDef *c2=item2->classDef;
+ if (c1==0 || c2==0)
return FALSE;
else
return qstricmp(c1->name(),c2->name());
diff --git a/src/classlist.cpp b/src/classlist.cpp
index f19c374..877e993 100644
--- a/src/classlist.cpp
+++ b/src/classlist.cpp
@@ -33,30 +33,26 @@ ClassList::~ClassList()
{
}
-static int compItems(void *item1,void *item2)
+static int compItems(const ClassDef *c1,const ClassDef *c2)
{
- ClassDef *c1=(ClassDef *)item1;
- ClassDef *c2=(ClassDef *)item2;
static bool b = Config_getBool("SORT_BY_SCOPE_NAME");
//printf("compItems: %d %s<->%s\n",b,c1->name().data(),c2->name().data());
if (b)
{
- return qstricmp(c1->name(),
- c2->name());
+ return qstricmp(c1->name(), c2->name());
}
else
{
- return qstricmp(c1->className(),
- c2->className());
+ return qstricmp(c1->className(), c2->className());
}
}
-int ClassList::compareItems(QCollection::Item item1, QCollection::Item item2)
+int ClassList::compareValues(const ClassDef *item1, const ClassDef *item2) const
{
return compItems(item1,item2);
}
-int ClassSDict::compareItems(QCollection::Item item1, QCollection::Item item2)
+int ClassSDict::compareValues(const ClassDef *item1, const ClassDef *item2) const
{
return compItems(item1,item2);
}
diff --git a/src/classlist.h b/src/classlist.h
index adc781c..6a4d09c 100644
--- a/src/classlist.h
+++ b/src/classlist.h
@@ -28,12 +28,13 @@ class Definition;
/** A list of ClassDef objects. */
class ClassList : public QList<ClassDef>
-{
+{
public:
ClassList();
~ClassList();
-
- int compareItems(QCollection::Item item1,QCollection::Item item2);
+
+ private:
+ int compareValues(const ClassDef *item1,const ClassDef *item2) const;
};
/** An iterator for ClassDef objects in a ClassList. */
@@ -57,11 +58,12 @@ class ClassSDict : public SDict<ClassDef>
public:
ClassSDict(int size=17) : SDict<ClassDef>(size) {}
~ClassSDict() {}
- int compareItems(QCollection::Item item1,QCollection::Item item2);
- void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0,
+ void writeDeclaration(OutputList &ol,const ClassDef::CompoundType *filter=0,
const char *header=0,bool localNames=FALSE);
- void writeDocumentation(OutputList &ol,Definition *container=0);
- bool declVisible(const ClassDef::CompoundType *filter=0) const;
+ void writeDocumentation(OutputList &ol,Definition *container=0);
+ bool declVisible(const ClassDef::CompoundType *filter=0) const;
+ private:
+ int compareValues(const ClassDef *item1,const ClassDef *item2) const;
};
class GenericsCollection : public QIntDict<ClassDef>
diff --git a/src/code.l b/src/code.l
index ba35f7d..832b2a3 100644
--- a/src/code.l
+++ b/src/code.l
@@ -299,21 +299,18 @@ ClassDef *VariableContext::findVariable(const QCString &name)
{
if (name.isEmpty()) return 0;
ClassDef *result = 0;
- //QListIterator<Scope> sli(m_scopes);
+ QListIterator<Scope> sli(m_scopes);
Scope *scope;
QCString key = name;
// search from inner to outer scope
- scope = m_scopes.last();
- //for (sli.toLast();(scope=sli.current());--sli)
- while (scope)
+ for (sli.toLast();(scope=sli.current());--sli)
{
result = scope->find(key);
- if (result)
+ if (result)
{
DBG_CTX((stderr,"** findVariable(%s)=%p\n",name.data(),result));
return result;
}
- scope = m_scopes.prev();
}
// nothing found -> also try the global scope
result=m_globalScope.find(name);
@@ -671,9 +668,10 @@ static void setParameterList(MemberDef *md)
{
g_classScope = md->getClassDef() ? md->getClassDef()->name().data() : "";
ArgumentList *al = md->argumentList();
- if (al==0) return;
- Argument *a = al->first();
- while (a)
+ if (al==0) return;
+ ArgumentListIterator it(*al);
+ Argument *a;
+ for (;(a=it.current());++it)
{
g_parmName = a->name.copy();
g_parmType = a->type.copy();
@@ -684,7 +682,6 @@ static void setParameterList(MemberDef *md)
g_parmType.stripPrefix("const ");
g_parmType=g_parmType.stripWhiteSpace();
g_theVarContext.addVariable(g_parmType,g_parmName);
- a = al->next();
}
}
@@ -803,13 +800,14 @@ static MemberDef *setCallContextForVar(const QCString &name)
}
else if (mn->count()>1) // global defined more than once
{
- MemberDef *md=mn->first();
- while (md)
+ MemberNameIterator it(*mn);
+ MemberDef *md;
+ for (;(md=it.current());++it)
{
//printf("mn=%p md=%p md->getBodyDef()=%p g_sourceFileDef=%p\n",
// mn,md,
// md->getBodyDef(),g_sourceFileDef);
-
+
// in case there are multiple members we could link to, we
// only link to members if defined in the same file or
// defined as external.
@@ -821,7 +819,6 @@ static MemberDef *setCallContextForVar(const QCString &name)
//printf("returning member %s in source file %s\n",md->name().data(),g_sourceFileDef->name().data());
return md;
}
- md=mn->next();
}
return 0;
}
diff --git a/src/config.l b/src/config.l
index 05df386..22deb4f 100644
--- a/src/config.l
+++ b/src/config.l
@@ -847,11 +847,11 @@ void Config::writeTemplate(FTextStream &t,bool sl,bool upd)
{
t << convertToComment(m_header,"");
}
- ConfigOption *option = m_options->first();
- while (option)
+ QListIterator<ConfigOption> it = iterator();
+ ConfigOption *option;
+ for (;(option=it.current());++it)
{
option->writeTemplate(t,sl,upd);
- option = m_options->next();
}
/* print last lines of user comment that were at the end of the file */
if (m_userComment)
@@ -863,11 +863,11 @@ void Config::writeTemplate(FTextStream &t,bool sl,bool upd)
void Config::convertStrToVal()
{
- ConfigOption *option = m_options->first();
- while (option)
+ QListIterator<ConfigOption> it = iterator();
+ ConfigOption *option;
+ for (;(option=it.current());++it)
{
option->convertStrToVal();
- option = m_options->next();
}
}
@@ -1003,11 +1003,11 @@ void ConfigEnum::substEnvVars()
void Config::substituteEnvironmentVars()
{
- ConfigOption *option = m_options->first();
- while (option)
+ QListIterator<ConfigOption> it = iterator();
+ ConfigOption *option;
+ for (;(option=it.current());++it)
{
option->substEnvVars();
- option = m_options->next();
}
}
@@ -1577,16 +1577,15 @@ void Config::check()
void Config::init()
{
- ConfigOption *option = m_options->first();
- while (option)
+ QListIterator<ConfigOption> it = iterator();
+ ConfigOption *option;
+ for (;(option=it.current());++it)
{
option->init();
- option = m_options->next();
}
// sanity check if all depends relations are valid
- option = m_options->first();
- while (option)
+ for (it.toFirst();(option=it.current());++it)
{
QCString depName = option->dependsOn();
if (!depName.isEmpty())
@@ -1599,7 +1598,6 @@ void Config::init()
exit(1);
}
}
- option = m_options->next();
}
}
diff --git a/src/dbusxmlscanner.cpp b/src/dbusxmlscanner.cpp
index 8b8df0d..e841428 100644
--- a/src/dbusxmlscanner.cpp
+++ b/src/dbusxmlscanner.cpp
@@ -252,7 +252,7 @@ public:
COND_DOC_ERROR(idx < 0, QString("Anonymous namespace found."));
m_namespaceStack.append(openNamespace(attributes.value(idx)));
- openScopes(m_namespaceStack.last());
+ openScopes(m_namespaceStack.getLast());
}
if (EXTENSION("struct"))
@@ -291,7 +291,7 @@ public:
m_currentEntry->type = getType(attributes).utf8();
QString type(getDBusType(m_currentEntry->type));
- m_structStack.last()->type.append(type.utf8());
+ m_structStack.getLast()->type.append(type.utf8());
}
if (EXTENSION("enum") || EXTENSION("flagset"))
@@ -348,9 +348,9 @@ public:
// Clean up elements stack:
// Since we made sure to get the elements in the proper order when
// adding we do not need to do so again here.
- COND_DOC_ERROR(m_elementStack.last()->element != qName.utf8(),
+ COND_DOC_ERROR(m_elementStack.getLast()->element != qName.utf8(),
QString("Malformed XML: Unexpected closing element found.").
- arg(m_elementStack.last()->element).utf8());
+ arg(m_elementStack.getLast()->element).utf8());
m_elementStack.removeLast();
// Interface:
@@ -389,7 +389,7 @@ public:
if (EXTENSION("namespace"))
{
- Entry * current = m_namespaceStack.last();
+ Entry * current = m_namespaceStack.getLast();
CONDITION(!current, "end of namespace without start.");
m_namespaceStack.removeLast();
@@ -399,7 +399,7 @@ public:
if (EXTENSION("struct"))
{
- StructData * data = m_structStack.last();
+ StructData * data = m_structStack.getLast();
CONDITION(!data, "end of struct without start.");
data->entry->endBodyLine = lineNumber();
@@ -418,7 +418,7 @@ public:
if (EXTENSION("member"))
{
- StructData * data = m_structStack.last();
+ StructData * data = m_structStack.getLast();
CONDITION(!data, "end of member outside struct.");
data->entry->addSubEntry(m_currentEntry);
}
@@ -625,7 +625,7 @@ private:
QCString scoped_name;
if (!m_scopeStack.isEmpty())
{
- scoped_name = m_scopeStack.last()->scope->name;
+ scoped_name = m_scopeStack.getLast()->scope->name;
scoped_name.append("::");
}
if (!type.isEmpty())
@@ -686,7 +686,7 @@ private:
Entry * current_namespace = openNamespace(scope);
if (!m_scopeStack.isEmpty())
- { m_scopeStack.last()->scope->addSubEntry(current_namespace); }
+ { m_scopeStack.getLast()->scope->addSubEntry(current_namespace); }
m_scopeStack.append(new ScopeData(current_namespace, m_scopeCount));
}
@@ -699,7 +699,7 @@ private:
object->name = scoped_name;
if (!m_scopeStack.isEmpty())
- { m_scopeStack.last()->scope->addSubEntry(object); }
+ { m_scopeStack.getLast()->scope->addSubEntry(object); }
m_scopeStack.append(new ScopeData(object, m_scopeCount));
++m_scopeCount;
@@ -721,13 +721,13 @@ private:
void closeScopes()
{
- const int current_scope_count(m_scopeStack.last()->count);
+ const int current_scope_count(m_scopeStack.getLast()->count);
// Do not close the root scope.
if (current_scope_count == 0)
{ return; }
- while (current_scope_count == m_scopeStack.last()->count)
+ while (current_scope_count == m_scopeStack.getLast()->count)
{ m_scopeStack.removeLast(); }
}
diff --git a/src/define.h b/src/define.h
index 843ecec..bc758c0 100644
--- a/src/define.h
+++ b/src/define.h
@@ -54,9 +54,10 @@ class DefineList : public QList<Define>
public:
DefineList() : QList<Define>() {}
~DefineList() {}
- int compareItems(QCollection::Item i1,QCollection::Item i2)
+ private:
+ int compareValues(const Define *d1,const Define *d2) const
{
- return qstricmp(((Define *)i1)->name,((Define *)i2)->name);
+ return qstricmp(d1->name,d2->name);
}
};
@@ -67,12 +68,12 @@ class DefineName : public QList<Define>
DefineName(const char *n) : QList<Define>() { name=n; }
~DefineName() {}
const char *nameString() const { return name; }
- int compareItems(QCollection::Item i1,QCollection::Item i2)
+
+ private:
+ int compareValues(const Define *d1,const Define *d2) const
{
- return qstricmp(((Define *)i1)->name,((Define *)i2)->name);
+ return qstricmp(d1->name,d2->name);
}
-
- private:
QCString name;
};
@@ -82,10 +83,10 @@ class DefineNameList : public QList<DefineName>
public:
DefineNameList() : QList<DefineName>() {}
~DefineNameList() {}
- int compareItems(QCollection::Item i1,QCollection::Item i2)
+ private:
+ int compareValues(const DefineName *n1,const DefineName *n2) const
{
- return qstricmp(((DefineName *)i1)->nameString(),
- ((DefineName *)i2)->nameString());
+ return qstricmp(n1->nameString(),n2->nameString());
}
};
diff --git a/src/definition.cpp b/src/definition.cpp
index 46147fc..8be2217 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -417,8 +417,9 @@ void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList)
{
if (!anchorList) return;
//printf("%s: addSectionsToDefinition(%d)\n",name().data(),anchorList->count());
- SectionInfo *si=anchorList->first();
- while (si)
+ QListIterator<SectionInfo> it(*anchorList);
+ SectionInfo *si;
+ for (;(si=it.current());++it)
{
//printf("Add section `%s' to definition `%s'\n",
// si->label.data(),name().data());
@@ -429,7 +430,7 @@ void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList)
gsi = new SectionInfo(*si);
Doxygen::sectionDict->append(si->label,gsi);
}
- if (m_impl->sectionDict==0)
+ if (m_impl->sectionDict==0)
{
m_impl->sectionDict = new SectionDict(17);
}
@@ -438,7 +439,6 @@ void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList)
m_impl->sectionDict->append(gsi->label,gsi);
gsi->definition = this;
}
- si=anchorList->next();
}
}
diff --git a/src/definition.h b/src/definition.h
index f444cc5..b798e14 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -371,11 +371,9 @@ class DefinitionList : public QList<Definition>, public DefinitionIntf
public:
~DefinitionList() {}
DefType definitionType() const { return TypeSymbolList; }
- int compareItems(QCollection::Item item1,QCollection::Item item2)
+ int compareValues(const Definition *item1,const Definition *item2) const
{
- return qstricmp(((Definition *)item1)->name(),
- ((Definition *)item2)->name()
- );
+ return qstricmp(item1->name(),item2->name());
}
};
diff --git a/src/diagram.cpp b/src/diagram.cpp
index 80d0646..a7d2aa4 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -209,18 +209,17 @@ static uint virtToMask(Specifier p)
// pre: dil is not empty
static Protection getMinProtectionLevel(DiagramItemList *dil)
{
- DiagramItem *di=dil->first();
+ QListIterator<DiagramItem> it(*dil);
+ DiagramItem *di=it.current();
Protection result=di->protection();
- di=dil->next();
- while (di)
+ for (++it;(di=it.current());++it)
{
Protection p=di->protection();
- if (p!=result)
+ if (p!=result)
{
if (result==Protected && p==Public) result=p;
else if (result==Private) result=p;
- }
- di=dil->next();
+ }
}
return result;
}
@@ -371,12 +370,12 @@ void DiagramRow::insertClass(DiagramItem *parent,ClassDef *cd,bool doBases,
if (bcl)
{
/* there are base/sub classes */
- BaseClassDef *bcd=bcl->first();
- while (bcd)
+ BaseClassListIterator it(*bcl);
+ BaseClassDef *bcd;
+ for (;(bcd=it.current());++it)
{
ClassDef *ccd=bcd->classDef;
if (ccd && ccd->isVisibleInHierarchy() /*&& !ccd->visited*/) count++;
- bcd=bcl->next();
}
}
if (count>0 && (prot!=Private || !doBases))
@@ -392,8 +391,9 @@ void DiagramRow::insertClass(DiagramItem *parent,ClassDef *cd,bool doBases,
row=diagram->at(level+1);
}
/* insert base classes in the next row */
- BaseClassDef *bcd=bcl->first();
- while (bcd)
+ BaseClassListIterator it(*bcl);
+ BaseClassDef *bcd;
+ for (;(bcd=it.current());++it)
{
ClassDef *ccd=bcd->classDef;
if (ccd && ccd->isVisibleInHierarchy() /*&& !ccd->visited*/)
@@ -402,7 +402,6 @@ void DiagramRow::insertClass(DiagramItem *parent,ClassDef *cd,bool doBases,
doBases?bcd->virt:Normal,
doBases?bcd->templSpecifiers.data():"");
}
- bcd=bcl->next();
}
}
}
@@ -423,12 +422,12 @@ TreeDiagram::~TreeDiagram()
void TreeDiagram::moveChildren(DiagramItem *root,int dx)
{
DiagramItemList *dil=root->getChildren();
- DiagramItem *di=dil->first();
- while (di)
+ QListIterator<DiagramItem> it(*dil);
+ DiagramItem *di;
+ for (;(di=it.current());++it)
{
di->move(dx,0);
moveChildren(di,dx);
- di=dil->next();
}
}
@@ -463,11 +462,11 @@ bool TreeDiagram::layoutTree(DiagramItem *root,int r)
}
// recurse to children
- DiagramItem *di=dil->first();
- while (di && !moved && !di->isInList())
+ QListIterator<DiagramItem> it(*dil);
+ DiagramItem *di;
+ for (;(di=it.current()) && !moved && !di->isInList();++it)
{
moved = layoutTree(di,r+1);
- di=dil->next();
}
}
return moved;
@@ -475,47 +474,49 @@ bool TreeDiagram::layoutTree(DiagramItem *root,int r)
void TreeDiagram::computeLayout()
{
- DiagramRow *row=first();
- while (row && row->count()<maxTreeWidth) row=next();
+ QListIterator<DiagramRow> it(*this);
+ DiagramRow *row;
+ for (;(row=it.current()) && row->count()<maxTreeWidth;++it) {}
if (row)
{
//printf("computeLayout() list row at %d\n",row->number());
- DiagramItem *di=row->first();
+ QListIterator<DiagramItem> rit(*row);
+ DiagramItem *di;
DiagramItem *opi=0;
int delta=0;
bool first=TRUE;
- while (di)
+ for (;(di=rit.current());++rit)
{
DiagramItem *pi=di->parentItem();
if (pi==opi && !first) { delta-=gridWidth; }
first = pi!=opi;
opi=pi;
- di->move(delta,0); // collapse all items in the same
+ di->move(delta,0); // collapse all items in the same
// list (except the first)
di->putInList();
- di=row->next();
}
}
// re-organize the diagram items
DiagramItem *root=getFirst()->getFirst();
while (layoutTree(root,0)) { }
-
+
// move first items of the lists
if (row)
{
- DiagramItem *di=row->first();
- while (di)
+ QListIterator<DiagramItem> rit(*row);
+ DiagramItem *di;
+ while ((di=rit.current()))
{
DiagramItem *pi=di->parentItem();
if (pi->getChildren()->count()>1)
{
di->move(gridWidth,0);
- while (di && di->parentItem()==pi) di=row->next();
+ while (di && di->parentItem()==pi) { ++rit; di=rit.current(); }
}
else
{
- di=row->next();
+ ++rit;
}
}
}
@@ -525,24 +526,25 @@ uint TreeDiagram::computeRows()
{
//printf("TreeDiagram::computeRows()=%d\n",count());
int count=0;
- DiagramRow *row=first();
- while (row && !row->getFirst()->isInList())
+ QListIterator<DiagramRow> it(*this);
+ DiagramRow *row;
+ for (;(row=it.current()) && !row->getFirst()->isInList();++it)
{
count++;
- row=next();
}
//printf("count=%d row=%p\n",count,row);
if (row)
{
int maxListLen=0;
int curListLen=0;
- DiagramItem *di=row->first(),*opi=0;
- while (di)
+ DiagramItem *opi=0;
+ QListIterator<DiagramItem> rit(*row);
+ DiagramItem *di;
+ for (;(di=rit.current());++rit)
{
if (di->parentItem()!=opi) curListLen=1; else curListLen++;
if (curListLen>maxListLen) maxListLen=curListLen;
opi=di->parentItem();
- di=row->next();
}
//printf("maxListLen=%d\n",maxListLen);
count+=maxListLen;
@@ -550,43 +552,22 @@ uint TreeDiagram::computeRows()
return count;
}
-#if 0
-uint TreeDiagram::computeCols()
-{
- uint count=0;
- DiagramRow *row=first();
- while (row && !row->getFirst()->isInList())
- {
- if (row->count()>count) count=row->count();
- row=next();
- }
- if (row)
- {
- row=prev();
- uint cols=row->count();
- if (row->getLast()->getChildren()->count()>1) cols++;
- if (cols>count) count=cols;
- }
- return count;
-};
-#endif
-
void TreeDiagram::computeExtremes(uint *maxLabelLen,uint *maxXPos)
{
uint ml=0,mx=0;
- DiagramRow *dr=first();
+ QListIterator<DiagramRow> it(*this);
+ DiagramRow *dr;
bool done=FALSE;
- while (dr && !done)
+ for (;(dr=it.current()) && !done;++it)
{
- DiagramItem *di=dr->first();
- while (di)
+ QListIterator<DiagramItem> rit(*dr);
+ DiagramItem *di;
+ for (;(di=rit.current());++rit)
{
if (di->isInList()) done=TRUE;
if (maxXPos) mx=QMAX(mx,(uint)di->xPos());
if (maxLabelLen) ml=QMAX(ml,Image::stringLength(di->label()));
- di=dr->next();
}
- dr=next();
}
if (maxLabelLen) *maxLabelLen=ml;
if (maxXPos) *maxXPos=mx;
@@ -599,20 +580,22 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image,
QCString relPath,
bool generateMap)
{
- DiagramRow *dr=first();
- if (!doBase) dr=next();
+ QListIterator<DiagramRow> it(*this);
+ DiagramRow *dr;
+ if (!doBase) ++it;
bool done=FALSE;
bool firstRow = doBase;
- while (dr && !done)
+ for (;(dr=it.current()) && !done;++it)
{
int x=0,y=0;
float xf=0.0f,yf=0.0f;
- DiagramItem *di=dr->first();
+ QListIterator<DiagramItem> rit(*dr);
+ DiagramItem *di = rit.current();
if (di->isInList()) // put boxes in a list
{
DiagramItem *opi=0;
- if (doBase) di=dr->last();
- while (di)
+ if (doBase) rit.toLast(); else rit.toFirst();
+ while ((di=rit.current()))
{
if (di->parentItem()==opi)
{
@@ -673,13 +656,13 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image,
writeVectorBox(t,di,xf,yf,di->getChildren()->count()>0);
}
- if (doBase) di=dr->prev(); else di=dr->next();
+ if (doBase) --rit; else ++rit;
}
done=TRUE;
}
else // draw a tree of boxes
{
- while (di)
+ for (rit.toFirst();(di=rit.current());++rit)
{
if (bitmap)
{
@@ -714,11 +697,8 @@ void TreeDiagram::drawBoxes(FTextStream &t,Image *image,
}
writeVectorBox(t,di,xf,yf);
}
-
- di=dr->next();
}
}
- dr=next();
firstRow=FALSE;
}
}
@@ -728,16 +708,18 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
uint baseRows,uint superRows,
uint cellWidth,uint cellHeight)
{
- DiagramRow *dr=first();
+ QListIterator<DiagramRow> it(*this);
+ DiagramRow *dr;
bool done=FALSE;
- while (dr && !done) // for each row
+ for (;(dr=it.current()) && !done;++it) // for each row
{
- DiagramItem *di=dr->first();
+ QListIterator<DiagramItem> rit(*dr);
+ DiagramItem *di = rit.current();
if (di->isInList()) // row consists of list connectors
{
int x=0,y=0,ys=0;
float xf=0.0f,yf=0.0f,ysf=0.0f;
- while (di)
+ for (;(di=rit.current());++rit)
{
DiagramItem *pi=di->parentItem();
DiagramItemList *dil=pi->getChildren();
@@ -849,7 +831,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
yf -= 1.0f;
}
}
- di=dr->next();
+ ++rit; di=rit.current();
}
// add last horizonal line and a vertical connection line
if (bitmap)
@@ -895,13 +877,12 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
}
}
- di=dr->next();
}
done=TRUE; // the tree is drawn now
}
else // normal tree connector
{
- while (di)
+ for (;(di=rit.current());++rit)
{
int x=0,y=0;
DiagramItemList *dil = di->getChildren();
@@ -988,8 +969,8 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
}
/* write input line */
- DiagramItem *first = dil->first();
- DiagramItem *last = dil->last();
+ DiagramItem *first = dil->getFirst();
+ DiagramItem *last = dil->getLast();
if (first!=last && !first->isInList()) /* connect with all base classes */
{
if (bitmap)
@@ -1027,9 +1008,7 @@ void TreeDiagram::drawConnectors(FTextStream &t,Image *image,
}
}
}
- di=dr->next();
}
- dr=next();
}
}
}
@@ -1053,8 +1032,8 @@ ClassDiagram::ClassDiagram(ClassDef *root)
clearVisitFlags();
super = new TreeDiagram(root,FALSE);
super->computeLayout();
- DiagramItem *baseItem = base->first()->first();
- DiagramItem *superItem = super->first()->first();
+ DiagramItem *baseItem = base->getFirst()->getFirst();
+ DiagramItem *superItem = super->getFirst()->getFirst();
int xbase = baseItem->xPos();
int xsuper = superItem->xPos();
if (xbase>xsuper)
@@ -1307,35 +1286,34 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
t << "boxfont setfont\n";
t << "1 boundaspect scale\n";
-
+
bool done=FALSE;
- DiagramRow *dr=base->first();
- while (dr && !done)
+ QListIterator<DiagramRow> bit(*base);
+ DiagramRow *dr;
+ for (;(dr=bit.current()) && !done;++bit)
{
- DiagramItem *di=dr->first();
- while (di)
+ QListIterator<DiagramItem> rit(*dr);
+ DiagramItem *di;
+ for (;(di=rit.current());++rit)
{
done=di->isInList();
t << "(" << di->label() << ") cw\n";
- di=dr->next();
}
- dr=base->next();
}
- dr=super->first();
- dr=super->next();
+ QListIterator<DiagramRow> sit(*super);
+ ++sit;
done=FALSE;
- while (dr && !done)
+ for (;(dr=sit.current()) && !done;++sit)
{
- DiagramItem *di=dr->first();
- while (di)
+ QListIterator<DiagramItem> rit(*dr);
+ DiagramItem *di;
+ for (;(di=rit.current());++rit)
{
done=di->isInList();
t << "(" << di->label() << ") cw\n";
- di=dr->next();
}
- dr=super->next();
}
-
+
t << "/boxwidth boxwidth marginwidth 2 mul add def\n"
<< "/xspacing boxwidth distx add def\n"
<< "/yspacing boxheight disty add def\n"
diff --git a/src/dirdef.cpp b/src/dirdef.cpp
index 5df047a..b7a2a92 100644
--- a/src/dirdef.cpp
+++ b/src/dirdef.cpp
@@ -224,8 +224,9 @@ void DirDef::writeSubDirList(OutputList &ol)
ol.parseText(theTranslator->trDir(TRUE,FALSE));
ol.endMemberHeader();
ol.startMemberList();
- DirDef *dd=m_subdirs.first();
- while (dd)
+ QListIterator<DirDef> it(m_subdirs);
+ DirDef *dd;
+ for (;(dd=it.current());++it)
{
ol.startMemberDeclaration();
ol.startMemberItem(dd->getOutputFileBase(),0);
@@ -250,7 +251,6 @@ void DirDef::writeSubDirList(OutputList &ol)
ol.endMemberDescription();
}
ol.endMemberDeclaration(0,0);
- dd=m_subdirs.next();
}
ol.endMemberList();
@@ -266,8 +266,9 @@ void DirDef::writeFileList(OutputList &ol)
ol.parseText(theTranslator->trFile(TRUE,FALSE));
ol.endMemberHeader();
ol.startMemberList();
- FileDef *fd=m_fileList->first();
- while (fd)
+ QListIterator<FileDef> it(*m_fileList);
+ FileDef *fd;
+ for (;(fd=it.current());++it)
{
ol.startMemberDeclaration();
ol.startMemberItem(fd->getOutputFileBase(),0);
@@ -313,7 +314,6 @@ void DirDef::writeFileList(OutputList &ol)
ol.endMemberDescription();
}
ol.endMemberDeclaration(0,0);
- fd=m_fileList->next();
}
ol.endMemberList();
}
@@ -584,10 +584,8 @@ bool DirDef::depGraphIsTrivial() const
//----------------------------------------------------------------------
-int FilePairDict::compareItems(QCollection::Item item1,QCollection::Item item2)
+int FilePairDict::compareValues(const FilePair *left,const FilePair *right) const
{
- FilePair *left = (FilePair*)item1;
- FilePair *right = (FilePair*)item2;
int orderHi = qstricmp(left->source()->name(),right->source()->name());
int orderLo = qstricmp(left->destination()->name(),right->destination()->name());
return orderHi==0 ? orderLo : orderHi;
diff --git a/src/dirdef.h b/src/dirdef.h
index 8b11b2e..dc2d01e 100644
--- a/src/dirdef.h
+++ b/src/dirdef.h
@@ -37,7 +37,7 @@ class DirDef;
class DirList : public QList<DirDef>
{
public:
- int compareItems(QCollection::Item item1,QCollection::Item item2);
+ int compareValues(const DirDef *item1,const DirDef *item2) const;
};
/** A model of a directory symbol. */
@@ -122,7 +122,8 @@ class FilePairDict : public SDict<FilePair>
{
public:
FilePairDict(int size) : SDict<FilePair>(size) {}
- int compareItems(QCollection::Item item1,QCollection::Item item2);
+ private:
+ int compareValues(const FilePair *item1,const FilePair *item2) const;
};
/** Usage information of a directory. */
@@ -160,9 +161,9 @@ class DirRelation
UsedDir *m_dst;
};
-inline int DirList::compareItems(QCollection::Item item1,QCollection::Item item2)
+inline int DirList::compareValues(const DirDef *item1,const DirDef *item2) const
{
- return qstricmp(((DirDef *)item1)->shortName(),((DirDef *)item2)->shortName());
+ return qstricmp(item1->shortName(),item2->shortName());
}
/** A sorted dictionary of DirDef objects. */
@@ -170,9 +171,9 @@ class DirSDict : public SDict<DirDef>
{
public:
DirSDict(int size) : SDict<DirDef>(size) {}
- int compareItems(QCollection::Item item1,QCollection::Item item2)
+ int compareValues(const DirDef *item1,const DirDef *item2) const
{
- return qstricmp(((DirDef *)item1)->shortName(),((DirDef *)item2)->shortName());
+ return qstricmp(item1->shortName(),item2->shortName());
}
};
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 4a18b4e..e1e750f 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1719,9 +1719,9 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
// first parse any number of paragraphs
bool isFirst=TRUE;
DocPara *lastPar=0;
- if (!children.isEmpty() && children.last()->kind()==DocNode::Kind_Para)
+ if (!children.isEmpty() && children.getLast()->kind()==DocNode::Kind_Para)
{ // last child item was a paragraph
- lastPar = (DocPara*)children.last();
+ lastPar = (DocPara*)children.getLast();
isFirst=FALSE;
}
do
@@ -4654,8 +4654,8 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator)
}
else
{
- ASSERT(m_children.last()->kind()==DocNode::Kind_Para);
- ((DocPara *)m_children.last())->markLast(FALSE);
+ ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.getLast())->markLast(FALSE);
}
par->markLast();
if (needsSeparator) m_children.append(new DocSimpleSectSep(this));
@@ -4705,8 +4705,8 @@ int DocSimpleSect::parseXml()
}
else
{
- ASSERT(m_children.last()->kind()==DocNode::Kind_Para);
- ((DocPara *)m_children.last())->markLast(FALSE);
+ ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.getLast())->markLast(FALSE);
}
par->markLast();
m_children.append(par);
@@ -4730,14 +4730,14 @@ int DocSimpleSect::parseXml()
void DocSimpleSect::appendLinkWord(const QCString &word)
{
DocPara *p;
- if (m_children.isEmpty() || m_children.last()->kind()!=DocNode::Kind_Para)
+ if (m_children.isEmpty() || m_children.getLast()->kind()!=DocNode::Kind_Para)
{
p = new DocPara(this);
m_children.append(p);
}
else
{
- p = (DocPara *)m_children.last();
+ p = (DocPara *)m_children.getLast();
// Comma-seperate <seealso> links.
p->injectToken(TK_WORD,",");
@@ -4881,7 +4881,7 @@ int DocParamList::parseXml(const QCString &paramName)
}
else
{
- m_paragraphs.last()->markLast(FALSE);
+ m_paragraphs.getLast()->markLast(FALSE);
}
par->markLast();
m_paragraphs.append(par);
@@ -4932,8 +4932,8 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
}
else
{
- ASSERT(m_children.last()->kind()==DocNode::Kind_ParamList);
- ((DocParamList *)m_children.last())->markLast(FALSE);
+ ASSERT(m_children.getLast()->kind()==DocNode::Kind_ParamList);
+ ((DocParamList *)m_children.getLast())->markLast(FALSE);
pl->markLast();
}
m_children.append(pl);
@@ -4959,12 +4959,12 @@ int DocPara::handleSimpleSection(DocSimpleSect::Type t, bool xmlContext)
DocSimpleSect *ss=0;
bool needsSeparator = FALSE;
if (!m_children.isEmpty() && // previous element
- m_children.last()->kind()==Kind_SimpleSect && // was a simple sect
- ((DocSimpleSect *)m_children.last())->type()==t && // of same type
+ m_children.getLast()->kind()==Kind_SimpleSect && // was a simple sect
+ ((DocSimpleSect *)m_children.getLast())->type()==t && // of same type
t!=DocSimpleSect::User) // but not user defined
{
// append to previous section
- ss=(DocSimpleSect *)m_children.last();
+ ss=(DocSimpleSect *)m_children.getLast();
needsSeparator = TRUE;
}
else // start new section
@@ -4991,11 +4991,11 @@ int DocPara::handleParamSection(const QCString &cmdName,
{
DocParamSect *ps=0;
if (!m_children.isEmpty() && // previous element
- m_children.last()->kind()==Kind_ParamSect && // was a param sect
- ((DocParamSect *)m_children.last())->type()==t) // of same type
+ m_children.getLast()->kind()==Kind_ParamSect && // was a param sect
+ ((DocParamSect *)m_children.getLast())->type()==t) // of same type
{
// append to previous section
- ps=(DocParamSect *)m_children.last();
+ ps=(DocParamSect *)m_children.getLast();
}
else // start new section
{
@@ -5086,13 +5086,15 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type
return;
}
DocIncOperator *op = new DocIncOperator(this,t,g_token->name,g_context,g_isExample,g_exampleName);
- DocNode *n1 = m_children.last();
- DocNode *n2 = n1!=0 ? m_children.prev() : 0;
+ QListIterator<DocNode> it(m_children);
+ DocNode *n1 = it.toLast();
+ --it;
+ DocNode *n2 = n1!=0 ? it.current() : 0;
bool isFirst = n1==0 || // no last node
- (n1->kind()!=DocNode::Kind_IncOperator &&
+ (n1->kind()!=DocNode::Kind_IncOperator &&
n1->kind()!=DocNode::Kind_WhiteSpace
) || // last node is not operator or whitespace
- (n1->kind()==DocNode::Kind_WhiteSpace &&
+ (n1->kind()==DocNode::Kind_WhiteSpace &&
n2!=0 && n2->kind()!=DocNode::Kind_IncOperator
); // previous not is not operator
op->markFirst(isFirst);
@@ -6468,7 +6470,7 @@ reparsetoken:
// remove leading whitespace
!m_children.isEmpty() &&
// and whitespace after certain constructs
- (k=m_children.last()->kind())!=DocNode::Kind_HtmlDescList &&
+ (k=m_children.getLast()->kind())!=DocNode::Kind_HtmlDescList &&
k!=DocNode::Kind_HtmlTable &&
k!=DocNode::Kind_HtmlList &&
k!=DocNode::Kind_SimpleSect &&
diff --git a/src/dot.cpp b/src/dot.cpp
index 8d9ba3f..56ddc83 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -783,10 +783,11 @@ class DotNodeList : public QList<DotNode>
public:
DotNodeList() : QList<DotNode>() {}
~DotNodeList() {}
- int compareItems(QCollection::Item item1,QCollection::Item item2)
- {
- return qstricmp(((DotNode *)item1)->m_label,((DotNode *)item2)->m_label);
- }
+ private:
+ int compareValues(const DotNode *n1,const DotNode *n2) const
+ {
+ return qstricmp(n1->m_label,n2->m_label);
+ }
};
//--------------------------------------------------------------------
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 41fca96..fe2f84e 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -220,7 +220,7 @@ class Statistics
}
void end()
{
- stats.last()->elapsed=((double)time.elapsed())/1000.0;
+ stats.getLast()->elapsed=((double)time.elapsed())/1000.0;
}
void print()
{
@@ -2319,7 +2319,7 @@ static MemberDef *addVariableToClass(
root->fileName,root->startLine,root->startColumn,
root->type,name,root->args,root->exception,
prot,Normal,root->stat,related,
- mtype,root->tArgLists ? root->tArgLists->last() : 0,0);
+ mtype,root->tArgLists ? root->tArgLists->getLast() : 0,0);
md->setTagInfo(rootNav->tagInfo());
md->setMemberClass(cd); // also sets outer scope (i.e. getOuterScope())
//md->setDefFile(root->fileName);
@@ -2556,7 +2556,7 @@ static MemberDef *addVariableToFile(
root->fileName,root->startLine,root->startColumn,
root->type,name,root->args,0,
Public, Normal,root->stat,Member,
- mtype,root->tArgLists ? root->tArgLists->last() : 0,0);
+ mtype,root->tArgLists ? root->tArgLists->getLast() : 0,0);
md->setTagInfo(rootNav->tagInfo());
md->setMemberSpecifiers(root->spec);
md->setDocumentation(root->doc,root->docFile,root->docLine);
@@ -3245,7 +3245,7 @@ static void addMethodToClass(EntryNav *rootNav,ClassDef *cd,
root->stat && root->relatesType != MemberOf,
root->relates.isEmpty() ? Member :
root->relatesType == MemberOf ? Foreign : Related,
- mtype,root->tArgLists ? root->tArgLists->last() : 0,root->argList);
+ mtype,root->tArgLists ? root->tArgLists->getLast() : 0,root->argList);
md->setTagInfo(rootNav->tagInfo());
md->setMemberClass(cd);
md->setDocumentation(root->doc,root->docFile,root->docLine);
@@ -3535,9 +3535,9 @@ static void buildFunctionList(EntryNav *rootNav)
)
{
GroupDef *gd=0;
- if (root->groups->first()!=0)
+ if (root->groups->getFirst()!=0)
{
- gd = Doxygen::groupSDict->find(root->groups->first()->groupname.data());
+ gd = Doxygen::groupSDict->find(root->groups->getFirst()->groupname.data());
}
//printf("match!\n");
//printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,nsName.data(),rnsName.data());
@@ -3598,7 +3598,7 @@ static void buildFunctionList(EntryNav *rootNav)
md->enableCallerGraph(md->hasCallerGraph() || root->callerGraph);
// merge ingroup specifiers
- if (md->getGroupDef()==0 && root->groups->first()!=0)
+ if (md->getGroupDef()==0 && root->groups->getFirst()!=0)
{
addMemberToGroups(root,md);
}
@@ -3607,7 +3607,7 @@ static void buildFunctionList(EntryNav *rootNav)
//printf("existing member is grouped, new member not\n");
root->groups->append(new Grouping(md->getGroupDef()->name(), md->getGroupPri()));
}
- else if (md->getGroupDef()!=0 && root->groups->first()!=0)
+ else if (md->getGroupDef()!=0 && root->groups->getFirst()!=0)
{
//printf("both members are grouped\n");
}
@@ -3629,7 +3629,7 @@ static void buildFunctionList(EntryNav *rootNav)
// root->type.data(),rname.data(),root->args.data(),root->bodyLine);
// new global function
- ArgumentList *tArgList = root->tArgLists ? root->tArgLists->last() : 0;
+ ArgumentList *tArgList = root->tArgLists ? root->tArgLists->getLast() : 0;
QCString name=removeRedundantWhiteSpace(rname);
md=new MemberDef(
root->fileName,root->startLine,root->startColumn,
@@ -5039,8 +5039,9 @@ static void computeTemplateClassRelations()
ArgumentList *templArgs = new ArgumentList;
stringToArgumentList(templSpec,templArgs);
QList<BaseInfo> *baseList=root->extends;
- BaseInfo *bi=baseList->first();
- while (bi) // for each base class of the template
+ QListIterator<BaseInfo> it(*baseList);
+ BaseInfo *bi;
+ for (;(bi=it.current());++it) // for each base class of the template
{
// check if the base class is a template argument
BaseInfo tbi(bi->name,bi->prot,bi->virt);
@@ -5082,7 +5083,6 @@ static void computeTemplateClassRelations()
}
delete actualTemplateNames;
}
- bi=baseList->next();
}
delete templArgs;
} // class has no base classes
@@ -5102,17 +5102,17 @@ static void computeMemberReferences()
for (cli.toFirst();(cd=cli.current());++cli)
{
cd->computeAnchors();
- }
- FileName *fn=Doxygen::inputNameList->first();
- while (fn)
+ }
+ FileNameListIterator fnli(*Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
{
- FileDef *fd=fn->first();
- while (fd)
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (;(fd=fni.current());++fni)
{
fd->computeAnchors();
- fd=fn->next();
}
- fn=Doxygen::inputNameList->next();
}
NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
NamespaceDef *nd=0;
@@ -5143,8 +5143,8 @@ static void addListReferences()
md->visited=FALSE;
}
}
- MemberNameSDict::Iterator fnli(*Doxygen::functionNameSDict);
- for (fnli.toFirst();(mn=fnli.current());++fnli)
+ MemberNameSDict::Iterator fmnli(*Doxygen::functionNameSDict);
+ for (fmnli.toFirst();(mn=fmnli.current());++fmnli)
{
MemberNameIterator mni(*mn);
MemberDef *md=0;
@@ -5159,30 +5159,34 @@ static void addListReferences()
for (cli.toFirst();(cd=cli.current());++cli)
{
cd->addListReferences();
- }
- FileName *fn=Doxygen::inputNameList->first();
- while (fn)
+ }
+
+ FileNameListIterator fnli(*Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
{
- FileDef *fd=fn->first();
- while (fd)
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (;(fd=fni.current());++fni)
{
fd->addListReferences();
- fd=fn->next();
}
- fn=Doxygen::inputNameList->next();
}
+
NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
NamespaceDef *nd=0;
for (nli.toFirst();(nd=nli.current());++nli)
{
nd->addListReferences();
}
+
GroupSDict::Iterator gli(*Doxygen::groupSDict);
GroupDef *gd;
for (gli.toFirst();(gd=gli.current());++gli)
{
gd->addListReferences();
}
+
PageSDict::Iterator pdi(*Doxygen::pageSDict);
PageDef *pd=0;
for (pdi.toFirst();(pd=pdi.current());++pdi)
@@ -5200,6 +5204,7 @@ static void addListReferences()
name,pd->title(),0);
}
}
+
DirSDict::Iterator ddi(*Doxygen::directories);
DirDef *dd = 0;
for (ddi.toFirst();(dd=ddi.current());++ddi)
@@ -5486,7 +5491,7 @@ static bool findGlobalMember(EntryNav *rootNav,
{
//printf("Comparing return types '%s'<->'%s'\n",
// md->typeString(),type);
- if (md->templateArguments()->count()!=root->tArgLists->last()->count() ||
+ if (md->templateArguments()->count()!=root->tArgLists->getLast()->count() ||
qstrcmp(md->typeString(),type)!=0)
{
//printf(" ---> no matching\n");
@@ -5579,10 +5584,12 @@ static QCString substituteTemplatesInString(
{
ArgumentListIterator tsali(*srclali.current());
ArgumentListIterator tdali(*dstlali.current());
+ ArgumentListIterator *fali=0;
Argument *tsa =0,*tda=0, *fa=0;
if (funcTempArgList)
{
- fa=funcTempArgList->first();
+ fali = new ArgumentListIterator(*funcTempArgList);
+ fa = fali->current();
}
for (tsali.toFirst();(tsa=tsali.current()) && !found;++tsali)
@@ -5615,11 +5622,13 @@ static QCString substituteTemplatesInString(
found=TRUE;
}
}
- if (tda)
- ++tdali;
- else if (fa)
- fa=funcTempArgList->next();
+ if (tda)
+ ++tdali;
+ else if (fali)
+ { ++(*fali); fa=fali->current(); }
}
+
+ delete fali;
//printf(" srcList='%s' dstList='%s faList='%s'\n",
// argListToString(srclali.current()).data(),
// argListToString(dstlali.current()).data(),
@@ -5643,8 +5652,9 @@ static void substituteTemplatesInArgList(
)
{
ArgumentListIterator sali(*src);
+ ArgumentListIterator dali(*dst);
Argument *sa=0;
- Argument *da=dst->first();
+ Argument *da=dali.current();
for (sali.toFirst();(sa=sali.current());++sali) // for each member argument
{
@@ -5666,7 +5676,8 @@ static void substituteTemplatesInArgList(
{
da->type=dstType;
da->type=dstArray;
- da=dst->next();
+ ++dali;
+ da=dali.current();
}
}
dst->constSpecifier = src->constSpecifier;
@@ -5862,7 +5873,7 @@ static void findMember(EntryNav *rootNav,
// this as a normal method of a template class.
if (!(root->tArgLists &&
root->tArgLists->count()>0 &&
- root->tArgLists->first()->count()==0
+ root->tArgLists->getFirst()->count()==0
)
)
{
@@ -5906,10 +5917,10 @@ static void findMember(EntryNav *rootNav,
ClassDef *cd=getClass(scopeName);
if (cd)
{
- if (root->tArgLists) root->tArgLists->first();
if (funcSpec.isEmpty())
{
- tempScopeName=cd->qualifiedNameWithTemplateParameters(root->tArgLists);
+ int argListIndex=0;
+ tempScopeName=cd->qualifiedNameWithTemplateParameters(root->tArgLists,&argListIndex);
}
else
{
@@ -5918,7 +5929,7 @@ static void findMember(EntryNav *rootNav,
}
//printf("scopeName=%s cd=%p root->tArgLists=%p result=%s\n",
// scopeName.data(),cd,root->tArgLists,tempScopeName.data());
-
+
//printf("scopeName=`%s' className=`%s'\n",scopeName.data(),className.data());
// rebuild the function declaration (needed to get the scope right).
if (!scopeName.isEmpty() && !isRelated && !isFriend && !Config_getBool("HIDE_SCOPE_NAMES"))
@@ -6128,8 +6139,8 @@ static void findMember(EntryNav *rootNav,
Debug::print(Debug::FindMembers,0,
"5b. Comparing return types '%s'<->'%s' #args %d<->%d\n",
md->typeString(),funcType.data(),
- md->templateArguments()->count(),root->tArgLists->last()->count());
- if (md->templateArguments()->count()!=root->tArgLists->last()->count() ||
+ md->templateArguments()->count(),root->tArgLists->getLast()->count());
+ if (md->templateArguments()->count()!=root->tArgLists->getLast()->count() ||
qstrcmp(memType,funcType))
{
//printf(" ---> no matching\n");
@@ -6467,11 +6478,12 @@ static void findMember(EntryNav *rootNav,
MemberName *mn = Doxygen::functionNameSDict->find(funcName);
if (mn)
{
- mdDefine = mn->first();
+ MemberNameIterator mni(*mn);
+ mdDefine = mni.current();
while (mdDefine && !isDefine)
{
isDefine = isDefine || mdDefine->isDefine();
- if (!isDefine) mdDefine = mn->next();
+ if (!isDefine) { ++mni; mdDefine=mni.current(); }
}
}
}
@@ -6485,8 +6497,9 @@ static void findMember(EntryNav *rootNav,
}
else
{
- MemberDef *rmd=mn->first();
- while (rmd && newMember) // see if we got another member with matching arguments
+ MemberNameIterator mni(*mn);
+ MemberDef *rmd;
+ while ((rmd=mni.current()) && newMember) // see if we got another member with matching arguments
{
ArgumentList *rmdAl = rmd->argumentList();
@@ -6495,7 +6508,7 @@ static void findMember(EntryNav *rootNav,
!matchArguments2(rmd->getOuterScope(),rmd->getFileDef(),rmdAl,
cd,fd,root->argList,
TRUE);
- if (newMember) rmd=mn->next();
+ if (newMember) ++mni;
}
if (!newMember && rmd) // member already exists as rmd -> add docs
{
@@ -6543,7 +6556,7 @@ static void findMember(EntryNav *rootNav,
root->stat && !isMemberOf,
isMemberOf ? Foreign : isRelated ? Related : Member,
mtype,
- (root->tArgLists ? root->tArgLists->last() : 0),
+ (root->tArgLists ? root->tArgLists->getLast() : 0),
funcArgs.isEmpty() ? 0 : root->argList);
if (isDefine && mdDefine)
@@ -6579,8 +6592,9 @@ static void findMember(EntryNav *rootNav,
MemberName *rmn=Doxygen::functionNameSDict->find(funcName);
if (rmn)
{
- MemberDef *rmd=rmn->first();
- while (rmd && !found) // see if we got another member with matching arguments
+ MemberNameIterator rmni(*rmn);
+ MemberDef *rmd;
+ while ((rmd=rmni.current()) && !found) // see if we got another member with matching arguments
{
ArgumentList *rmdAl = rmd->argumentList();
// check for matching argument lists
@@ -6592,7 +6606,7 @@ static void findMember(EntryNav *rootNav,
{
found=TRUE;
}
- if (!found) rmd=rmn->next();
+ if (!found) ++rmni;
}
if (rmd) // member found -> copy line number info
{
@@ -7423,7 +7437,7 @@ static void findEnumDocumentation(EntryNav *rootNav)
md->setRefItems(root->sli);
GroupDef *gd=md->getGroupDef();
- if (gd==0 &&root->groups->first()!=0) // member not grouped but out-of-line documentation is
+ if (gd==0 &&root->groups->getFirst()!=0) // member not grouped but out-of-line documentation is
{
addMemberToGroups(root,md);
}
@@ -7457,7 +7471,7 @@ static void findEnumDocumentation(EntryNav *rootNav)
md->setMemberGroupId(root->mGrpId);
GroupDef *gd=md->getGroupDef();
- if (gd==0 && root->groups->first()!=0) // member not grouped but out-of-line documentation is
+ if (gd==0 && root->groups->getFirst()!=0) // member not grouped but out-of-line documentation is
{
addMemberToGroups(root,md);
}
@@ -7574,11 +7588,12 @@ static void computeMemberRelations()
for ( ; (mn=mnli.current()) ; ++mnli ) // for each member name
{
MemberNameIterator mdi(*mn);
+ MemberNameIterator bmdi(*mn);
MemberDef *md;
+ MemberDef *bmd;
for ( ; (md=mdi.current()) ; ++mdi ) // for each member with a specific name
{
- MemberDef *bmd = mn->first(); // for each other member with the same name
- while (bmd)
+ for ( bmdi.toFirst() ; (bmd=bmdi.current()); ++bmdi ) // for each other member with the same name
{
ClassDef *mcd = md->getClassDef();
if (mcd && mcd->baseClasses())
@@ -7625,10 +7640,9 @@ static void computeMemberRelations()
}
}
}
- bmd = mn->next();
}
}
- }
+ }
}
@@ -8132,16 +8146,16 @@ static void addMembersToMemberGroup()
cd->addMembersToMemberGroup();
}
// for each file
- FileName *fn=Doxygen::inputNameList->first();
- while (fn)
+ FileNameListIterator fnli(*Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
{
- FileDef *fd=fn->first();
- while (fd)
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (fni.toFirst();(fd=fni.current());++fni)
{
fd->addMembersToMemberGroup();
- fd=fn->next();
}
- fn=Doxygen::inputNameList->next();
}
// for each namespace
NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
@@ -8171,16 +8185,16 @@ static void distributeMemberGroupDocumentation()
cd->distributeMemberGroupDocumentation();
}
// for each file
- FileName *fn=Doxygen::inputNameList->first();
- while (fn)
+ FileNameListIterator fnli(*Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
{
- FileDef *fd=fn->first();
- while (fd)
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (fni.toFirst();(fd=fni.current());++fni)
{
fd->distributeMemberGroupDocumentation();
- fd=fn->next();
}
- fn=Doxygen::inputNameList->next();
}
// for each namespace
NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
@@ -8210,16 +8224,16 @@ static void findSectionsInDocumentation()
cd->findSectionsInDocumentation();
}
// for each file
- FileName *fn=Doxygen::inputNameList->first();
- while (fn)
+ FileNameListIterator fnli(*Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
{
- FileDef *fd=fn->first();
- while (fd)
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (fni.toFirst();(fd=fni.current());++fni)
{
fd->findSectionsInDocumentation();
- fd=fn->next();
}
- fn=Doxygen::inputNameList->next();
}
// for each namespace
NamespaceSDict::Iterator nli(*Doxygen::namespaceSDict);
@@ -8380,17 +8394,16 @@ static void findDefineDocumentation(EntryNav *rootNav)
MemberName *mn=Doxygen::functionNameSDict->find(root->name);
if (mn)
{
+ MemberNameIterator mni(*mn);
+ MemberDef *md;
int count=0;
- MemberDef *md=mn->first();
- while (md)
+ for (;(md=mni.current());++mni)
{
if (md->memberType()==MemberType_Define) count++;
- md=mn->next();
}
if (count==1)
{
- md=mn->first();
- while (md)
+ for (mni.toFirst();(md=mni.current());++mni)
{
if (md->memberType()==MemberType_Define)
{
@@ -8409,20 +8422,18 @@ static void findDefineDocumentation(EntryNav *rootNav)
if (root->mGrpId!=-1) md->setMemberGroupId(root->mGrpId);
addMemberToGroups(root,md);
}
- md=mn->next();
}
}
- else if (count>1 &&
- (!root->doc.isEmpty() ||
- !root->brief.isEmpty() ||
+ else if (count>1 &&
+ (!root->doc.isEmpty() ||
+ !root->brief.isEmpty() ||
root->bodyLine!=-1
)
- )
+ )
// multiple defines don't know where to add docs
// but maybe they are in different files together with their documentation
{
- md=mn->first();
- while (md)
+ for (mni.toFirst();(md=mni.current());++mni)
{
if (md->memberType()==MemberType_Define)
{
@@ -8456,7 +8467,6 @@ static void findDefineDocumentation(EntryNav *rootNav)
addMemberToGroups(root,md);
}
}
- md=mn->next();
}
//warn("define %s found in the following files:\n",root->name.data());
//warn("Cannot determine where to add the documentation found "
@@ -9255,16 +9265,15 @@ static void parseFiles(Entry *root,EntryNav *rootNav)
// create a dictionary with files to process
QDict<void> g_filesToProcess(10007);
- QCString *s=g_inputFiles.first();
- while (s)
+ StringListIterator it(g_inputFiles);
+ QCString *s;
+ for (;(s=it.current());++it)
{
g_filesToProcess.insert(*s,(void*)0x8);
- s=g_inputFiles.next();
}
- s=g_inputFiles.first();
// process source files (and their include dependencies)
- while (s)
+ for (it.toFirst();(s=it.current());++it)
{
bool ambig;
FileDef *fd=findFileDef(Doxygen::inputNameDict,s->data(),ambig);
@@ -9298,11 +9307,9 @@ static void parseFiles(Entry *root,EntryNav *rootNav)
parser->finishTranslationUnit();
g_processedFiles.insert(*s,(void*)0x8);
}
- s=g_inputFiles.next();
}
// process remaining files
- s=g_inputFiles.first();
- while (s)
+ for (it.toFirst();(s=it.current());++it)
{
if (!g_processedFiles.find(*s)) // not yet processed
{
@@ -9316,14 +9323,14 @@ static void parseFiles(Entry *root,EntryNav *rootNav)
parser->finishTranslationUnit();
g_processedFiles.insert(*s,(void*)0x8);
}
- s=g_inputFiles.next();
}
}
else // normal pocessing
#endif
{
- QCString *s=g_inputFiles.first();
- while (s)
+ StringListIterator it(g_inputFiles);
+ QCString *s;
+ for (;(s=it.current());++it)
{
bool ambig;
QStrList filesInSameTu;
@@ -9332,7 +9339,6 @@ static void parseFiles(Entry *root,EntryNav *rootNav)
ParserInterface * parser = getParserForFile(s->data());
parser->startTranslationUnit(s->data());
parseFile(parser,root,rootNav,fd,s->data(),FALSE,filesInSameTu);
- s=g_inputFiles.next();
}
}
}
diff --git a/src/doxygen.h b/src/doxygen.h