summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-01-27 15:31:12 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-01-27 15:31:12 (GMT)
commit74bb3ee26dd3e253ab63406b8b8966ea1bdb60f4 (patch)
tree6c8b165a0f4ca628de3e14b90da875e4c53a690c /src
parent6dfd523718e5879b9da5b95134572c9326b0dc80 (diff)
downloadDoxygen-74bb3ee26dd3e253ab63406b8b8966ea1bdb60f4.zip
Doxygen-74bb3ee26dd3e253ab63406b8b8966ea1bdb60f4.tar.gz
Doxygen-74bb3ee26dd3e253ab63406b8b8966ea1bdb60f4.tar.bz2
issue #8357 XML output does not include cross-references in code-fragments
In case of explicit code samples the language was not specified for the code and the code was parsed verbatim. Same was valid for code in the Docbook output. The LaTeX version has been taken as reference for the implementation.
Diffstat (limited to 'src')
-rw-r--r--src/docbookgen.cpp4
-rw-r--r--src/docbookvisitor.cpp4
-rw-r--r--src/docbookvisitor.h2
-rw-r--r--src/xmldocvisitor.cpp5
-rw-r--r--src/xmldocvisitor.h2
-rw-r--r--src/xmlgen.cpp2
6 files changed, 10 insertions, 9 deletions
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp
index 8d390b6..372a462 100644
--- a/src/docbookgen.cpp
+++ b/src/docbookgen.cpp
@@ -610,11 +610,11 @@ DB_GEN_C
}
}
-void DocbookGenerator::writeDoc(DocNode *n,const Definition *,const MemberDef *,int)
+void DocbookGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int)
{
DB_GEN_C
DocbookDocVisitor *visitor =
- new DocbookDocVisitor(t,*this);
+ new DocbookDocVisitor(t,*this,ctx?ctx->getDefFileExtension():QCString(""));
n->accept(visitor);
delete visitor;
}
diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp
index a448ac5..84d85c7 100644
--- a/src/docbookvisitor.cpp
+++ b/src/docbookvisitor.cpp
@@ -150,8 +150,8 @@ void DocbookDocVisitor::visitPostEnd(FTextStream &t, bool hasCaption, bool inlin
}
}
-DocbookDocVisitor::DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci)
- : DocVisitor(DocVisitor_Docbook), m_t(t), m_ci(ci)
+DocbookDocVisitor::DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt)
+ : DocVisitor(DocVisitor_Docbook), m_t(t), m_ci(ci),m_langExt(langExt)
{
DB_VIS_C
// m_t << "<section>" << endl;
diff --git a/src/docbookvisitor.h b/src/docbookvisitor.h
index bec7a12..ad53116 100644
--- a/src/docbookvisitor.h
+++ b/src/docbookvisitor.h
@@ -29,7 +29,7 @@ class QCString;
class DocbookDocVisitor : public DocVisitor
{
public:
- DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci);
+ DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
~DocbookDocVisitor();
//--------------------------------------
// visitor functions for leaf nodes
diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp
index 56b4546..56d6f55 100644
--- a/src/xmldocvisitor.cpp
+++ b/src/xmldocvisitor.cpp
@@ -88,8 +88,9 @@ static void visitPostEnd(FTextStream &t, const char *cmd)
t << "</" << cmd << ">" << endl;
}
-XmlDocVisitor::XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci)
- : DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE)
+XmlDocVisitor::XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt)
+ : DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE),
+ m_langExt(langExt)
{
}
diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h
index d0981a2..60270b8 100644
--- a/src/xmldocvisitor.h
+++ b/src/xmldocvisitor.h
@@ -30,7 +30,7 @@ class QCString;
class XmlDocVisitor : public DocVisitor
{
public:
- XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci);
+ XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci,const char *langExt);
//--------------------------------------
// visitor functions for leaf nodes
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index d002295..db62e1b 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -419,7 +419,7 @@ static void writeXMLDocBlock(FTextStream &t,
// create a code generator
XMLCodeGenerator *xmlCodeGen = new XMLCodeGenerator(t);
// create a parse tree visitor for XML
- XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen);
+ XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen,scope?scope->getDefFileExtension():QCString(""));
// visit all nodes
root->accept(visitor);
// clean up