diff options
Diffstat (limited to 'src/docbookvisitor.cpp')
-rw-r--r-- | src/docbookvisitor.cpp | 116 |
1 files changed, 60 insertions, 56 deletions
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index ca31e07..a42a895 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -263,7 +263,9 @@ DB_VIS_C case DocStyleChange::Small: /* XSLT Stylesheets can be used */ break; /* HTML only */ case DocStyleChange::Strike: break; + case DocStyleChange::Del: break; case DocStyleChange::Underline: break; + case DocStyleChange::Ins: break; case DocStyleChange::Div: /* HTML only */ break; case DocStyleChange::Span: /* HTML only */ break; } @@ -386,13 +388,14 @@ DB_VIS_C { m_t << "<literallayout><computeroutput>"; QFileInfo cfi( inc->file() ); - FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() ); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text(), langExt, inc->isExample(), - inc->exampleFile(), &fd); + inc->exampleFile(), fd); + delete fd; m_t << "</computeroutput></literallayout>"; } break; @@ -407,9 +410,8 @@ DB_VIS_C m_t << "</computeroutput></literallayout>"; break; case DocInclude::DontInclude: - break; + case DocInclude::DontIncWithLines: case DocInclude::HtmlInclude: - break; case DocInclude::LatexInclude: break; case DocInclude::VerbInclude: @@ -432,7 +434,7 @@ DB_VIS_C case DocInclude::SnipWithLines: { QFileInfo cfi( inc->file() ); - FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + FileDef *fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() ); m_t << "<literallayout><computeroutput>"; Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci, @@ -441,13 +443,14 @@ DB_VIS_C langExt, inc->isExample(), inc->exampleFile(), - &fd, + fd, lineBlock(inc->text(),inc->blockId()), -1, // endLine FALSE, // inlineFragment 0, // memberDef TRUE // show line number ); + delete fd; m_t << "</computeroutput></literallayout>"; } break; @@ -471,16 +474,33 @@ DB_VIS_C pushEnabled(); m_hide = TRUE; } - SrcLangExt langExt = getLanguageFromFileName(m_langExt); + QCString locLangExt = getFileNameExtension(op->includeFileName()); + if (locLangExt.isEmpty()) locLangExt = m_langExt; + SrcLangExt langExt = getLanguageFromFileName(locLangExt); if (op->type()!=DocIncOperator::Skip) { popEnabled(); if (!m_hide) { - Doxygen::parserManager->getParser(m_langExt) + FileDef *fd = 0; + if (!op->includeFileName().isEmpty()) + { + QFileInfo cfi( op->includeFileName() ); + fd = createFileDef( cfi.dirPath().utf8(), cfi.fileName().utf8() ); + } + + Doxygen::parserManager->getParser(locLangExt) ->parseCode(m_ci,op->context(), op->text(),langExt,op->isExample(), - op->exampleFile()); + op->exampleFile(), + fd, // fileDef + op->line(), // startLine + -1, // endLine + FALSE, // inline fragment + 0, // memberDef + op->showLineNo() // show line numbers + ); + if (fd) delete fd; } pushEnabled(); m_hide=TRUE; @@ -618,152 +638,152 @@ DB_VIS_C case DocSimpleSect::See: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trSeeAlso() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSeeAlso()) << "</title>" << endl; } break; case DocSimpleSect::Return: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trReturns()<< ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trReturns()<< "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trReturns()) << "</title>" << endl; } break; case DocSimpleSect::Author: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, TRUE) << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, TRUE)) << "</title>" << endl; } break; case DocSimpleSect::Authors: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trAuthor(TRUE, FALSE) << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trAuthor(TRUE, FALSE)) << "</title>" << endl; } break; case DocSimpleSect::Version: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trVersion() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trVersion() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trVersion()) << "</title>" << endl; } break; case DocSimpleSect::Since: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trSince() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trSince() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trSince()) << "</title>" << endl; } break; case DocSimpleSect::Date: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trDate() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trDate() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trDate()) << "</title>" << endl; } break; case DocSimpleSect::Note: if (m_insidePre) { - m_t << "<note><title>" << theTranslator->trNote() << ": </title>" << endl; + m_t << "<note><title>" << theTranslator->trNote() << "</title>" << endl; } else { - m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << ": </title>" << endl; + m_t << "<note><title>" << convertToDocBook(theTranslator->trNote()) << "</title>" << endl; } break; case DocSimpleSect::Warning: if (m_insidePre) { - m_t << "<warning><title>" << theTranslator->trWarning() << ": </title>" << endl; + m_t << "<warning><title>" << theTranslator->trWarning() << "</title>" << endl; } else { - m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << ": </title>" << endl; + m_t << "<warning><title>" << convertToDocBook(theTranslator->trWarning()) << "</title>" << endl; } break; case DocSimpleSect::Pre: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trPrecondition() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trPrecondition() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPrecondition()) << "</title>" << endl; } break; case DocSimpleSect::Post: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trPostcondition() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trPostcondition() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trPostcondition()) << "</title>" << endl; } break; case DocSimpleSect::Copyright: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trCopyright() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trCopyright() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trCopyright()) << "</title>" << endl; } break; case DocSimpleSect::Invar: if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trInvariant() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trInvariant() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trInvariant()) << "</title>" << endl; } break; case DocSimpleSect::Remark: // <remark> is miising the <title> possibility if (m_insidePre) { - m_t << "<formalpara><title>" << theTranslator->trRemarks() << ": </title>" << endl; + m_t << "<formalpara><title>" << theTranslator->trRemarks() << "</title>" << endl; } else { - m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << ": </title>" << endl; + m_t << "<formalpara><title>" << convertToDocBook(theTranslator->trRemarks()) << "</title>" << endl; } break; case DocSimpleSect::Attention: if (m_insidePre) { - m_t << "<caution><title>" << theTranslator->trAttention() << ": </title>" << endl; + m_t << "<caution><title>" << theTranslator->trAttention() << "</title>" << endl; } else { - m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << ": </title>" << endl; + m_t << "<caution><title>" << convertToDocBook(theTranslator->trAttention()) << "</title>" << endl; } break; case DocSimpleSect::User: @@ -951,7 +971,7 @@ DB_VIS_C if (m_hide) return; m_t << "<informaltable frame=\"all\">" << endl; m_t << " <tgroup cols=\"" << t->numColumns() << "\" align=\"left\" colsep=\"1\" rowsep=\"1\">" << endl; - for (int i = 0; i <t->numColumns(); i++) + for (uint i = 0; i <t->numColumns(); i++) { // do something with colwidth based of cell width specification (be aware of possible colspan in the header)? m_t << " <colspec colname='c" << i+1 << "'/>\n"; @@ -1508,22 +1528,6 @@ DB_VIS_C m_t << " "; } -void DocbookDocVisitor::visitPre(DocCopy *) -{ -DB_VIS_C - if (m_hide) return; - // TODO: to be implemented -} - - -void DocbookDocVisitor::visitPost(DocCopy *) -{ -DB_VIS_C - if (m_hide) return; - // TODO: to be implemented -} - - void DocbookDocVisitor::visitPre(DocText *) { DB_VIS_C |