diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 1 | ||||
-rw-r--r-- | src/config.l | 1 | ||||
-rw-r--r-- | src/context.cpp | 8 | ||||
-rw-r--r-- | src/docparser.cpp | 26 | ||||
-rw-r--r-- | src/docsets.cpp | 4 | ||||
-rw-r--r-- | src/doxygen.cpp | 7 | ||||
-rw-r--r-- | src/fortrancode.l | 2 | ||||
-rw-r--r-- | src/fortranscanner.l | 15 | ||||
-rw-r--r-- | src/ftvhelp.cpp | 1 | ||||
-rw-r--r-- | src/groupdef.cpp | 2 | ||||
-rw-r--r-- | src/htmldocvisitor.cpp | 22 | ||||
-rw-r--r-- | src/htmlgen.cpp | 2 | ||||
-rw-r--r-- | src/index.cpp | 4 | ||||
-rw-r--r-- | src/latexdocvisitor.cpp | 136 | ||||
-rw-r--r-- | src/latexdocvisitor.h | 84 | ||||
-rw-r--r-- | src/layout.cpp | 2 | ||||
-rw-r--r-- | src/membergroup.cpp | 2 | ||||
-rw-r--r-- | src/outputgen.cpp | 5 | ||||
-rw-r--r-- | src/template.cpp | 15 | ||||
-rw-r--r-- | src/translator_tw.h | 13 | ||||
-rw-r--r-- | src/util.cpp | 4 | ||||
-rw-r--r-- | src/vhdldocgen.cpp | 2 | ||||
-rw-r--r-- | src/vhdljjparser.cpp | 5 |
23 files changed, 228 insertions, 135 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 95428d6..1584094 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1960,7 +1960,6 @@ void ClassDef::writeDocumentationContents(OutputList &ol,const QCString & /*page QCString pageType = " "; pageType += compoundTypeString(); - toupper(pageType.at(1)); Doxygen::indexList->addIndexItem(this,0); diff --git a/src/config.l b/src/config.l index 2cdb123..bda3c6a 100644 --- a/src/config.l +++ b/src/config.l @@ -1756,6 +1756,7 @@ static QCString configFileToString(const char *name) if (!fileOpened) { config_err("cannot open file `%s' for reading\n",name); + exit(1); } return ""; } diff --git a/src/context.cpp b/src/context.cpp index f76c49b..e7c14d5 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -1709,7 +1709,7 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private> MemberList *ml = m_classDef->getMemberList(type); if (ml) { - list.reset(MemberListInfoContext::alloc(m_classDef,relPathAsString(),ml,title,detailed)); + list.reset(MemberListInfoContext::alloc(m_classDef,relPathAsString(),ml,title,"")); } } if (list) @@ -2312,7 +2312,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri MemberList *ml = m_namespaceDef->getMemberList(type); if (ml) { - list.reset(MemberListInfoContext::alloc(m_namespaceDef,relPathAsString(),ml,title,detailed)); + list.reset(MemberListInfoContext::alloc(m_namespaceDef,relPathAsString(),ml,title,"")); } } if (list) @@ -2672,7 +2672,7 @@ class FileContext::Private : public DefinitionContext<FileContext::Private> MemberList *ml = m_fileDef->getMemberList(type); if (ml) { - list.reset(MemberListInfoContext::alloc(m_fileDef,relPathAsString(),ml,title,detailed)); + list.reset(MemberListInfoContext::alloc(m_fileDef,relPathAsString(),ml,title,"")); } } if (list) @@ -4453,7 +4453,7 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> MemberList *ml = m_groupDef->getMemberList(type); if (ml) { - list.reset(MemberListInfoContext::alloc(m_groupDef,relPathAsString(),ml,title,detailed)); + list.reset(MemberListInfoContext::alloc(m_groupDef,relPathAsString(),ml,title,"")); } } if (list) diff --git a/src/docparser.cpp b/src/docparser.cpp index d1362f0..c3963c9 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -511,18 +511,9 @@ static void checkUndocumentedParams() errMsg+=" parameter '"+argName+"'"; } } - if (g_memberDef->inheritsDocsFrom()) - { - warn_doc_error(g_memberDef->getDefFileName(), - g_memberDef->getDefLine(), - substitute(errMsg,"%","%%")); - } - else - { - warn_doc_error(g_memberDef->getDefFileName(), - g_memberDef->getDefLine(), - substitute(errMsg,"%","%%")); - } + warn_doc_error(g_memberDef->getDefFileName(), + g_memberDef->getDefLine(), + substitute(errMsg,"%","%%")); } } } @@ -594,7 +585,8 @@ static void detectNoDocumentedParams() g_memberDef->setHasDocumentedParams(TRUE); } } - //printf("Member %s hasReturnCommand=%d\n",g_memberDef->name().data(),g_hasReturnCommand); + //printf("Member %s hadDocumentedReturnType()=%d hasReturnCommand=%d\n", + // g_memberDef->name().data(),g_memberDef->hasDocumentedReturnType(),g_hasReturnCommand); if (!g_memberDef->hasDocumentedReturnType() && // docs not yet found g_hasReturnCommand) { @@ -611,7 +603,7 @@ static void detectNoDocumentedParams() { g_memberDef->setHasDocumentedReturnType(TRUE); } - if ( // see if return type is documented in a function w/o return type + else if ( // see if return type is documented in a function w/o return type g_memberDef->hasDocumentedReturnType() && (returnType.isEmpty() || // empty return type returnType.find("void")!=-1 || // void return type @@ -5953,7 +5945,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta { if (Config_getBool("WARN_NO_PARAMDOC")) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"empty 'name' attribute for <param> tag."); + warn_doc_error(g_fileName,doctokenizerYYlineno,"empty 'name' attribute for <param%s> tag.",tagId==XML_PARAM?"":"type"); } } else @@ -5965,7 +5957,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta } else { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing 'name' attribute from <param> tag."); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing 'name' attribute from <param%s> tag.",tagId==XML_PARAM?"":"type"); } } break; @@ -5998,7 +5990,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta } else { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing 'name' attribute from <exception> tag."); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Missing 'cref' attribute from <exception> tag."); } } break; diff --git a/src/docsets.cpp b/src/docsets.cpp index cde317d..9772d4e 100644 --- a/src/docsets.cpp +++ b/src/docsets.cpp @@ -468,10 +468,6 @@ void DocSets::addIndexItem(Definition *context,MemberDef *md, if (ii) { decl=ii->includeName; - if (decl.isEmpty()) - { - decl=ii->local; - } } } else if (nd) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 918cf82..4ff533d 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -2074,7 +2074,10 @@ static void findUsingDeclarations(EntryNav *rootNav) else { Debug::print(Debug::Classes,0," Found used class %s in scope=%s\n", - qPrint(usingCd->name()),nd?qPrint(nd->name()):qPrint(fd->name())); + qPrint(usingCd->name()), + nd?qPrint(nd->name()): + fd?qPrint(fd->name()): + "<unknown>"); } if (nd) @@ -6120,7 +6123,7 @@ static void findMember(EntryNav *rootNav, // stripTemplateSpecifiersFromScope(scopeName,FALSE).data()); ClassDef *tcd=findClassDefinition(fd,nd,scopeName); - if (tcd==0 && stripAnonymousNamespaceScope(cd->name())==scopeName) + if (tcd==0 && cd && stripAnonymousNamespaceScope(cd->name())==scopeName) { // don't be fooled by anonymous scopes tcd=cd; diff --git a/src/fortrancode.l b/src/fortrancode.l index af1a82e..fb91a83 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -795,7 +795,7 @@ PREFIX (RECURSIVE{BS_}|IMPURE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,3}(RECURSIVE|I codifyLines(yytext); endFontClass(); } -<Start>"implicit"{BS}"none" { +<Start>"implicit"{BS}("none"|{TYPE_SPEC}) { startFontClass("keywordtype"); codifyLines(yytext); endFontClass(); diff --git a/src/fortranscanner.l b/src/fortranscanner.l index cbe13fd..bd1fe83 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -100,13 +100,14 @@ struct SymbolModifiers { bool pass; bool contiguous; bool volat; /* volatile is a reserverd name */ + bool value; /* volatile is a reserverd name */ QCString passVar; SymbolModifiers() : type(), returnName(), protection(NONE_P), direction(NONE_D), optional(FALSE), protect(FALSE), dimension(), allocatable(FALSE), external(FALSE), intrinsic(FALSE), parameter(FALSE), pointer(FALSE), target(FALSE), save(FALSE), deferred(FALSE), nonoverridable(FALSE), - nopass(FALSE), pass(FALSE), contiguous(FALSE), volat(FALSE), passVar() {} + nopass(FALSE), pass(FALSE), contiguous(FALSE), volat(FALSE), value(FALSE), passVar() {} SymbolModifiers& operator|=(const SymbolModifiers &mdfs); SymbolModifiers& operator|=(QCString mdfrString); @@ -259,7 +260,7 @@ CHAR (CHARACTER{ARGS}?|CHARACTER{BS}"*"({BS}[0-9]+|{ARGS})) TYPE_SPEC (({NUM_TYPE}({BS}"*"{BS}[0-9]+)?)|({NUM_TYPE}{KIND})|DOUBLE{BS}COMPLEX|DOUBLE{BS}PRECISION|{CHAR}|TYPE{ARGS}|CLASS{ARGS}|PROCEDURE{ARGS}?) INTENT_SPEC intent{BS}"("{BS}(in|out|in{BS}out){BS}")" -ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE|CONTIGUOUS|VOLATILE) +ATTR_SPEC (EXTERNAL|ALLOCATABLE|DIMENSION{ARGS}|{INTENT_SPEC}|INTRINSIC|OPTIONAL|PARAMETER|POINTER|PROTECTED|PRIVATE|PUBLIC|SAVE|TARGET|NOPASS|PASS{ARGS}?|DEFERRED|NON_OVERRIDABLE|CONTIGUOUS|VOLATILE|VALUE) ACCESS_SPEC (PRIVATE|PUBLIC) LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")" /* Assume that attribute statements are almost the same as attributes. */ @@ -1652,6 +1653,7 @@ SymbolModifiers& SymbolModifiers::operator|=(const SymbolModifiers &mdfs) passVar = mdfs.passVar; contiguous |= mdfs.contiguous; volat |= mdfs.volat; + value |= mdfs.value; return *this; } @@ -1738,6 +1740,10 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfString) { newMdf.volat = TRUE; } + else if (mdfString=="value") + { + newMdf.value = TRUE; + } else if (mdfString.contains("pass")) { newMdf.pass = TRUE; @@ -1902,6 +1908,11 @@ static QCString applyModifiers(QCString typeName, SymbolModifiers& mdfs) if (!typeName.isEmpty()) typeName += ", "; typeName += "volatile"; } + if (mdfs.value) + { + if (!typeName.isEmpty()) typeName += ", "; + typeName += "value"; + } return typeName; } diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index e2774a9..a70e243 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -171,6 +171,7 @@ void FTVHelp::decContentsDepth() /*! Add a list item to the contents file. * \param isDir TRUE if the item is a directory, FALSE if it is a text + * \param name The name of the item. * \param ref the URL of to the item. * \param file the file containing the definition of the item * \param anchor the anchor within the file. diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 2d7674d..55d3733 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -1071,7 +1071,7 @@ void GroupDef::writeDocumentation(OutputList &ol) { //static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); ol.pushGeneratorState(); - startFile(ol,getOutputFileBase(),name(),title,HLI_None); + startFile(ol,getOutputFileBase(),name(),title,HLI_Modules); ol.startHeaderSection(); writeSummaryLinks(ol); diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 54dca32..2e9795e 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -1037,7 +1037,7 @@ void HtmlDocVisitor::visitPre(DocPara *p) void HtmlDocVisitor::visitPost(DocPara *p) { bool needsTag = FALSE; - if (p && p->parent()) + if (p->parent()) { switch (p->parent()->kind()) { @@ -1067,7 +1067,7 @@ void HtmlDocVisitor::visitPost(DocPara *p) // the paragraph (<ul>,<dl>,<table>) then that will already have ended the // paragraph and we don't need to do it here int nodeIndex = p->children().count()-1; - if (p && nodeIndex>=0) + if (nodeIndex>=0) { while (nodeIndex>=0 && p->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace) { @@ -1301,6 +1301,11 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t) forceEndParagraph(t); + if (t->hasCaption()) + { + m_t << "<a class=\"anchor\" id=\"" << t->caption()->anchor() << "\"></a>\n"; + } + QString attrs = htmlAttribsToString(t->attribs()); if (attrs.isEmpty()) { @@ -1353,21 +1358,11 @@ void HtmlDocVisitor::visitPost(DocHtmlCell *c) void HtmlDocVisitor::visitPre(DocHtmlCaption *c) { if (m_hide) return; - if (c->hasCaptionId()) - { - m_t << "<a class=\"anchor\" id=\"" << c->anchor() << "\"></a>\n"; - } bool hasAlign = FALSE; HtmlAttribListIterator li(c->attribs()); HtmlAttrib *att; QCString id; - for (li.toFirst();(att=li.current());++li) - { - if (att->name=="align") hasAlign=TRUE; - } - m_t << "<caption" << htmlAttribsToString(c->attribs()); - if (!hasAlign) m_t << " align=\"bottom\""; - m_t << ">"; + m_t << "<caption" << htmlAttribsToString(c->attribs()) << ">"; } void HtmlDocVisitor::visitPost(DocHtmlCaption *) @@ -1813,7 +1808,6 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b) { if (m_hide) return; forceEndParagraph(b); - QString attrs = htmlAttribsToString(b->attribs()); if (attrs.isEmpty()) { diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index e8da420..e6431e8 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -653,7 +653,7 @@ void HtmlCodeGenerator::startCodeLine(bool hasLineNumbers) void HtmlCodeGenerator::endCodeLine() { - if (m_streamSet) m_t << "</div>\n"; + if (m_streamSet) m_t << "</div>"; } void HtmlCodeGenerator::startFontClass(const char *s) diff --git a/src/index.cpp b/src/index.cpp index e7ba8e7..06d2185 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -3787,7 +3787,7 @@ static void writeIndex(OutputList &ol) { title = theTranslator->trMainPage(); } - else + else if (Doxygen::mainPage) { title = filterTitle(Doxygen::mainPage->title()); } @@ -4086,7 +4086,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry for (i=oldSize;i<newSize;i++) indexWritten.at(i)=FALSE; } //printf("starting %s kind=%d\n",lne->title().data(),lne->kind()); - bool addToIndex=lne==0 || lne->visible(); + bool addToIndex=lne->visible(); bool needsClosing=FALSE; if (!indexWritten.at(index)) { diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 22b3b32..5e7278c 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -172,10 +172,9 @@ LatexDocVisitor::LatexDocVisitor(FTextStream &t,CodeOutputInterface &ci, const char *langExt,bool insideTabbing) : DocVisitor(DocVisitor_Latex), m_t(t), m_ci(ci), m_insidePre(FALSE), m_insideItem(FALSE), m_hide(FALSE), m_hideCaption(FALSE), m_insideTabbing(insideTabbing), - m_insideTable(FALSE), m_langExt(langExt), m_currentColumn(0), - m_inRowspan(FALSE), m_inColspan(FALSE), m_firstRow(FALSE) + m_langExt(langExt) { - m_rowSpans.setAutoDelete(TRUE); + m_tableStateStack.setAutoDelete(TRUE); } //-------------------------------------- @@ -890,7 +889,7 @@ void LatexDocVisitor::visitPost(DocHtmlDescData *) { } -static const char *getTableName(const DocNode *n) +static bool tableIsNested(const DocNode *n) { bool isNested=FALSE; while (n && !isNested) @@ -898,14 +897,39 @@ static const char *getTableName(const DocNode *n) isNested = n->kind()==DocNode::Kind_HtmlTable || n->kind()==DocNode::Kind_ParamSect; n = n->parent(); } - return isNested ? "TabularNC" : "TabularC"; + return isNested; +} + +static void writeStartTableCommand(FTextStream &t,const DocNode *n,int cols) +{ + if (tableIsNested(n)) + { + t << "\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}"; + } + else + { + t << "\\tabulinesep=1mm\n\\begin{longtabu} spread 0pt [c]{*" << cols << "{|X[-1]}|}\n"; + } + //return isNested ? "TabularNC" : "TabularC"; +} + +static void writeEndTableCommand(FTextStream &t,const DocNode *n) +{ + if (tableIsNested(n)) + { + t << "\\end{tabularx}\n"; + } + else + { + t << "\\end{longtabu}\n"; + } + //return isNested ? "TabularNC" : "TabularC"; } void LatexDocVisitor::visitPre(DocHtmlTable *t) { - m_rowSpans.clear(); - m_insideTable=TRUE; if (m_hide) return; + pushTableState(); if (t->hasCaption()) { DocHtmlCaption *c = t->caption(); @@ -918,7 +942,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) m_t << endl; } - m_t << "\\begin{" << getTableName(t->parent()) << "}{" << t->numColumns() << "}\n"; + writeStartTableCommand(m_t,t->parent(),t->numColumns()); if (t->hasCaption()) { @@ -930,7 +954,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) m_t << "\\\\\n"; } - m_numCols = t->numColumns(); + setNumCols(t->numColumns()); m_t << "\\hline\n"; // check if first row is a heading and then render the row already here @@ -939,17 +963,17 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t) DocHtmlRow *firstRow = t->firstRow(); if (firstRow && firstRow->isHeading()) { - m_firstRow=TRUE; + setFirstRow(TRUE); firstRow->accept(this); - m_firstRow=FALSE; + setFirstRow(FALSE); } } void LatexDocVisitor::visitPost(DocHtmlTable *t) { - m_insideTable=FALSE; if (m_hide) return; - m_t << "\\end{" << getTableName(t->parent()) << "}\n"; + writeEndTableCommand(m_t,t->parent()); + popTableState(); } void LatexDocVisitor::visitPre(DocHtmlCaption *c) @@ -965,7 +989,7 @@ void LatexDocVisitor::visitPost(DocHtmlCaption *c) void LatexDocVisitor::visitPre(DocHtmlRow *r) { - m_currentColumn = 0; + setCurrentColumn(0); if (r->isHeading()) m_t << "\\rowcolor{\\tableheadbgcolor}"; } @@ -973,15 +997,15 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) { if (m_hide) return; - int c=m_currentColumn; - while (c<=m_numCols) // end of row while inside a row span? + int c=currentColumn(); + while (c<=numCols()) // end of row while inside a row span? { uint i; - for (i=0;i<m_rowSpans.count();i++) + for (i=0;i<rowSpans().count();i++) { - ActiveRowSpan *span = m_rowSpans.at(i); - //printf(" founc row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d\n", - // span->column, span->rowSpan,span->colSpan,row->rowIndex(),span->cell->rowIndex()); + ActiveRowSpan *span = rowSpans().at(i); + //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n", + // span->column, span->rowSpan,span->colSpan,row->rowIndex(),span->cell->rowIndex(),i,c); if (span->rowSpan>0 && span->column==c && // we are at a cell in a row span row->rowIndex()>span->cell->rowIndex() // but not the row that started the span ) @@ -991,9 +1015,9 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) { m_t << "\\multicolumn{" << span->colSpan << "}{"; m_t << "p{(\\linewidth-\\tabcolsep*" - << m_numCols << "-\\arrayrulewidth*" + << numCols() << "-\\arrayrulewidth*" << row->visibleCells() << ")*" - << span->colSpan <<"/"<< m_numCols << "}|}{}"; + << span->colSpan <<"/"<< numCols() << "}|}{}"; } else // solitary row span { @@ -1008,9 +1032,9 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) int col = 1; uint i; - for (i=0;i<m_rowSpans.count();i++) + for (i=0;i<rowSpans().count();i++) { - ActiveRowSpan *span = m_rowSpans.at(i); + ActiveRowSpan *span = rowSpans().at(i); if (span->rowSpan>0) span->rowSpan--; if (span->rowSpan<=0) { @@ -1027,16 +1051,16 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row) } } - if (col <= m_numCols) + if (col <= numCols()) { - m_t << "\\cline{" << col << "-" << m_numCols << "}"; + m_t << "\\cline{" << col << "-" << numCols() << "}"; } m_t << "\n"; if (row->isHeading() && row->rowIndex()==1) { - if (m_firstRow) + if (firstRow()) { m_t << "\\endfirsthead" << endl; m_t << "\\hline" << endl; @@ -1059,32 +1083,32 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) { row = (DocHtmlRow*)c->parent(); } - - m_currentColumn++; + + setCurrentColumn(currentColumn()+1); //Skip columns that span from above. uint i; - for (i=0;i<m_rowSpans.count();i++) + for (i=0;i<rowSpans().count();i++) { - ActiveRowSpan *span = m_rowSpans.at(i); - if (span->rowSpan>0 && span->column==m_currentColumn) + ActiveRowSpan *span = rowSpans().at(i); + if (span->rowSpan>0 && span->column==currentColumn()) { if (row && span->colSpan>1) { m_t << "\\multicolumn{" << span->colSpan << "}{"; - if (m_currentColumn /*c->columnIndex()*/==1) // add extra | for first column + if (currentColumn() /*c->columnIndex()*/==1) // add extra | for first column { m_t << "|"; } m_t << "p{(\\linewidth-\\tabcolsep*" - << m_numCols << "-\\arrayrulewidth*" + << numCols() << "-\\arrayrulewidth*" << row->visibleCells() << ")*" - << span->colSpan <<"/"<< m_numCols << "}|}{}"; - m_currentColumn+=span->colSpan; + << span->colSpan <<"/"<< numCols() << "}|}{}"; + setCurrentColumn(currentColumn()+span->colSpan); } else { - m_currentColumn++; + setCurrentColumn(currentColumn()+1); } m_t << "&"; } @@ -1093,23 +1117,26 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) int cs = c->colSpan(); if (cs>1 && row) { - m_inColspan = TRUE; + setInColSpan(TRUE); m_t << "\\multicolumn{" << cs << "}{"; if (c->columnIndex()==1) // add extra | for first column { m_t << "|"; } m_t << "p{(\\linewidth-\\tabcolsep*" - << m_numCols << "-\\arrayrulewidth*" + << numCols() << "-\\arrayrulewidth*" << row->visibleCells() << ")*" - << cs <<"/"<< m_numCols << "}|}{"; + << cs <<"/"<< numCols() << "}|}{"; if (c->isHeading()) m_t << "\\cellcolor{\\tableheadbgcolor}"; } int rs = c->rowSpan(); if (rs>0) { - m_inRowspan = TRUE; - m_rowSpans.append(new ActiveRowSpan(c,rs,cs,m_currentColumn)); + setInRowSpan(TRUE); + //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n", + // c->rowIndex(),c->columnIndex(),c->rowSpan(),c->colSpan(), + // currentColumn()); + addRowSpan(new ActiveRowSpan(c,rs,cs,currentColumn())); m_t << "\\multirow{" << rs << "}{\\linewidth}{"; } int a = c->alignment(); @@ -1127,7 +1154,7 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c) } if (cs>1) { - m_currentColumn+=cs-1; + setCurrentColumn(currentColumn()+cs-1); } } @@ -1138,14 +1165,14 @@ void LatexDocVisitor::visitPost(DocHtmlCell *c) { m_t << "}"; } - if (m_inRowspan) + if (inRowSpan()) { - m_inRowspan = FALSE; + setInRowSpan(FALSE); m_t << "}"; } - if (m_inColspan) + if (inColSpan()) { - m_inColspan = FALSE; + setInColSpan(FALSE); m_t << "}"; } if (!c->isLast()) m_t << "&"; @@ -1603,15 +1630,22 @@ void LatexDocVisitor::filter(const char *str) void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,bool refToTable) { static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS"); - if (ref.isEmpty() && pdfHyperLinks) // internal PDF link + if (ref.isEmpty() && pdfHyperLinks) // internal PDF link { - m_t << "\\hyperlink{"; + if (refToTable) + { + m_t << "\\doxytablelink{"; + } + else + { + m_t << "\\hyperlink{"; + } if (!file.isEmpty()) m_t << stripPath(file); if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_"; if (!anchor.isEmpty()) m_t << anchor; m_t << "}{"; } - else if (refToTable) + else if (ref.isEmpty() && refToTable) { m_t << "\\doxytableref{"; } @@ -1620,7 +1654,7 @@ void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const Q m_t << "\\doxyref{"; } else // external link - { + { m_t << "{\\bf "; } } diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index de797ae..02df1ef 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -192,15 +192,85 @@ class LatexDocVisitor : public DocVisitor bool m_hide; bool m_hideCaption; bool m_insideTabbing; - bool m_insideTable; - int m_numCols; QStack<bool> m_enabled; QCString m_langExt; - RowSpanList m_rowSpans; - int m_currentColumn; - bool m_inRowspan; - bool m_inColspan; - bool m_firstRow; + + struct TableState + { + TableState() : numCols(0), currentColumn(0), inRowSpan(FALSE), + inColSpan(FALSE), firstRow(FALSE) + { rowSpans.setAutoDelete(TRUE); } + RowSpanList rowSpans; + int numCols; + int currentColumn; + bool inRowSpan; + bool inColSpan; + bool firstRow; + }; + QStack<TableState> m_tableStateStack; // needed for nested tables + RowSpanList m_emptyRowSpanList; + + void pushTableState() + { + m_tableStateStack.push(new TableState); + } + void popTableState() + { + delete m_tableStateStack.pop(); + } + int currentColumn() const + { + return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->currentColumn : 0; + } + void setCurrentColumn(int col) + { + if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->currentColumn = col; + } + int numCols() const + { + return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->numCols : 0; + } + void setNumCols(int num) + { + if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->numCols = num; + } + bool inRowSpan() const + { + return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inRowSpan : FALSE; + } + void setInRowSpan(bool b) + { + if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inRowSpan = b; + } + bool inColSpan() const + { + return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inColSpan : FALSE; + } + void setInColSpan(bool b) + { + if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inColSpan = b; + } + bool firstRow() const + { + return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->firstRow : FALSE; + } + void setFirstRow(bool b) + { + if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->firstRow = b; + } + const RowSpanList &rowSpans() + { + return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->rowSpans : m_emptyRowSpanList; + } + void addRowSpan(ActiveRowSpan *span) + { + if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->rowSpans.append(span); + } + bool insideTable() const + { + return !m_tableStateStack.isEmpty(); + } + }; #endif diff --git a/src/layout.cpp b/src/layout.cpp index 75cb6b3..01d5d18 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -888,7 +888,7 @@ class LayoutParser : public QXmlDefaultHandler // no MainPage node... add one as the first item of the root node... new LayoutNavEntry(m_rootNav,LayoutNavEntry::MainPage, TRUE, /*Config_getBool("GENERATE_TREEVIEW") ? "main" :*/ "index", - theTranslator->trMainPage(),TRUE); + theTranslator->trMainPage(),"",TRUE); } } diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 4bf7721..08f951c 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -76,7 +76,7 @@ void MemberGroup::insertMember(MemberDef *md) // md,md->name().data()); MemberDef *firstMd = memberList->getFirst(); - if (inSameSection && memberList->count()>0 && + if (inSameSection && firstMd && firstMd->getSectionList(m_parent)!=md->getSectionList(m_parent)) { inSameSection=FALSE; diff --git a/src/outputgen.cpp b/src/outputgen.cpp index 31f682e..53d2d7f 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -44,11 +44,6 @@ void OutputGenerator::startPlainFile(const char *name) //printf("startPlainFile(%s)\n",name); fileName=dir+"/"+name; file = new QFile(fileName); - if (!file) - { - err("Could not create file object for %s\n",fileName.data()); - exit(1); - } if (!file->open(IO_WriteOnly)) { err("Could not open file %s for writing\n",fileName.data()); diff --git a/src/template.cpp b/src/template.cpp index 4250f08..5102978 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -1978,16 +1978,13 @@ class ExpressionParser TRACE(("{parseLiteral(%s)\n",m_curToken.id.data())); ExprAst *expr = new ExprAstLiteral(m_curToken.id); getNextToken(); - if (expr) + while (m_curToken.type==ExprToken::Operator && + m_curToken.op==Operator::Filter) { - while (m_curToken.type==ExprToken::Operator && - m_curToken.op==Operator::Filter) - { - getNextToken(); - ExprAstFilter *filter = parseFilter(); - if (!filter) break; - expr = new ExprAstFilterAppl(expr,filter); - } + getNextToken(); + ExprAstFilter *filter = parseFilter(); + if (!filter) break; + expr = new ExprAstFilterAppl(expr,filter); } TRACE(("}parseLiteral()\n")); return expr; diff --git a/src/translator_tw.h b/src/translator_tw.h index e61ab5c..31aeede 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -749,8 +749,7 @@ class TranslatorChinesetraditional : public Translator /*! This is put at the bottom of a class documentation page and is * followed by a list of files that were used to generate the page. */ - virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType, - bool single) + virtual QCString trGeneratedFromFiles(ClassDef::CompoundType compType,bool) { // here s is one of " Class", " Struct" or " Union" // single is true implies a single file QCString result=(QCString)"此"; @@ -766,7 +765,7 @@ class TranslatorChinesetraditional : public Translator default: break; } result+=" 文件是由下列檔案中產生"; - if (single) result+=":"; else result+=":"; + result+=":"; return result; } @@ -1948,21 +1947,21 @@ class TranslatorChinesetraditional : public Translator return result; } /** UNO IDL service page */ - virtual QCString trServiceGeneratedFromFiles(bool single) + virtual QCString trServiceGeneratedFromFiles(bool) { // single is true implies a single file QCString result=(QCString)"本服務的文件由以下的檔案" "所產生"; - if (single) result+=":"; else result+=":"; + result+=":"; return result; } /** UNO IDL singleton page */ - virtual QCString trSingletonGeneratedFromFiles(bool single) + virtual QCString trSingletonGeneratedFromFiles(bool) { // single is true implies a single file QCString result=(QCString)"本singleton的文件由下面的檔案" "所產生"; - if (single) result+=":"; else result+=":"; + result+=":"; return result; } diff --git a/src/util.cpp b/src/util.cpp index db6a19c..0467953 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4291,7 +4291,7 @@ bool getDefs(const QCString &scName, bool found=FALSE; MemberListIterator mmli(*mn); MemberDef *mmd; - for (mmli.toFirst();((mmd=mmli.current()) && !found);++mmli) + for (mmli.toFirst();(mmd=mmli.current());++mmli) { MemberDef *tmd = mmd->getEnumScope(); //printf("try member %s tmd=%s\n",mmd->name().data(),tmd?tmd->name().data():"<none>"); @@ -8353,7 +8353,7 @@ void convertProtectionLevel( if (extractPrivate) { *outListType1=MemberListType_pubSlots; - *outListType1=MemberListType_proSlots; + *outListType2=MemberListType_proSlots; } else { diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 029d0bd..3ea9b18 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -967,7 +967,6 @@ QCString VhdlDocGen::getClassTitle(const ClassDef *cd) { QCString pageTitle; if (cd==0) return ""; - pageTitle+=cd->displayName(); pageTitle=VhdlDocGen::getClassName(cd); int ii=cd->protection(); pageTitle+=" "; @@ -2163,7 +2162,6 @@ void VhdlDocGen::writeVHDLDeclaration(MemberDef* mdef,OutputList &ol, { if (VhdlDocGen::isConfig(mdef) || VhdlDocGen::isCompInst(mdef)) { - nn=mdef->getOutputFileBase(); nn=ltype; } else diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp index ea43341..acef592 100644 --- a/src/vhdljjparser.cpp +++ b/src/vhdljjparser.cpp @@ -407,7 +407,10 @@ void VhdlParser::addCompInst(const char *n, const char* instName, const char* co current->type=instName; // foo:instname e.g proto or work. proto(ttt) current->exception=genLabels.lower(); // |arch|label1:label2... current->name=n; // foo - current->args=lastCompound->name; // architecture name + if (lastCompound) + { + current->args=lastCompound->name; // architecture name + } current->includeName=comp; // component/enity/configuration int u=genLabels.find("|",1); if (u>0) |