diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-12-30 17:55:14 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-12-30 17:55:14 (GMT) |
commit | 6e51abf63021dc9fe32c05f003232fe68a08591d (patch) | |
tree | e9fe6f526e4a2b22b1a55659331c15750969a019 /src/docparser.cpp | |
parent | 744d1ca52e25dfa9e3d656056d87ed7cb6320585 (diff) | |
download | Doxygen-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/docparser.cpp')
-rw-r--r-- | src/docparser.cpp | 46 |
1 files changed, 24 insertions, 22 deletions
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 ¶mName) } 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 && |