diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-03-22 10:51:35 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-03-22 10:51:35 (GMT) |
commit | babe5c7ddea960ca2052d7f1d1a54dca14a644a2 (patch) | |
tree | 7199fbe9dae6fd0fec490469e9666daeb2bd3e38 | |
parent | 10d9b312444888e5ba0a1a7c5502c2f910d45759 (diff) | |
parent | 7c3b332d233965544467f5e84e249e5985587cb2 (diff) | |
download | Doxygen-babe5c7ddea960ca2052d7f1d1a54dca14a644a2.zip Doxygen-babe5c7ddea960ca2052d7f1d1a54dca14a644a2.tar.gz Doxygen-babe5c7ddea960ca2052d7f1d1a54dca14a644a2.tar.bz2 |
Merge branch 'master' of github.com:doxygen/doxygen
-rwxr-xr-x | addon/doxywizard/doxywizard.cpp | 6 | ||||
-rw-r--r-- | src/ftvhelp.cpp | 4 | ||||
-rw-r--r-- | src/rtfdocvisitor.cpp | 34 | ||||
-rw-r--r-- | src/rtfgen.cpp | 38 | ||||
-rw-r--r-- | src/rtfgen.h | 3 | ||||
-rw-r--r-- | src/util.cpp | 1 |
6 files changed, 74 insertions, 12 deletions
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index 5f8b1bc..27c99da 100755 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -548,7 +548,11 @@ void MainWindow::readStdout() { text1 += text; m_outputLog->clear(); - m_outputLog->append(APPQT(text1.trimmed())); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + m_outputLog->append(APPQT(text1.toHtmlEscaped().trimmed())); +#else + m_outputLog->append(APPQT(Qt::escape(text1).trimmed())); +#endif } } } diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index c556b43..d231dad 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -451,6 +451,10 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in char icon=compoundIcon(dynamic_cast<const ClassDef*>(n->def)); t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>"; } + else if (n->def && n->def->definitionType()==Definition::TypeDir) + { + t << "<span class=\"iconfclosed\"></span>"; + } else { t << "<span class=\"icondoc\"></span>"; diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index e1a9e31..f9b30f7 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -1107,14 +1107,30 @@ void RTFDocVisitor::visitPre(DocHRef *href) DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n"); if (Config_getBool(RTF_HYPERLINKS)) { - m_t << "{\\field " - "{\\*\\fldinst " - "{ HYPERLINK \"" << href->url() << "\" " - "}{}" - "}" - "{\\fldrslt " - "{\\cs37\\ul\\cf2 "; - + if (href->url().startsWith("#CITEREF")) + { + // when starting with #CITEREF it is a doxygen generated "url"a + // so a local link + QCString cite; + cite = "citelist_" + href->url().right(href->url().length()-1); + m_t << "{\\field " + "{\\*\\fldinst " + "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" " + "}{}" + "}" + "{\\fldrslt " + "{\\cs37\\ul\\cf2 "; + } + else + { + m_t << "{\\field " + "{\\*\\fldinst " + "{ HYPERLINK \"" << href->url() << "\" " + "}{}" + "}" + "{\\fldrslt " + "{\\cs37\\ul\\cf2 "; + } } else { @@ -1621,7 +1637,7 @@ void RTFDocVisitor::visitPre(DocXRefItem *x) m_t << "{\\field " "{\\*\\fldinst " - "{ HYPERLINK \\\\l \"" << refName << "\" " + "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" " "}{}" "}" "{\\fldrslt " diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index ae1a77e..1a11989 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -79,6 +79,16 @@ RTFGenerator::~RTFGenerator() { } +void RTFGenerator::setRelativePath(const QCString &path) +{ + m_relPath = path; +} + +void RTFGenerator::setSourceFileName(const QCString &name) +{ + m_sourceFileName = name; +} + void RTFGenerator::writeStyleSheetFile(QFile &file) { FTextStream t(&file); @@ -358,6 +368,8 @@ void RTFGenerator::startFile(const char *name,const char *,const char *) if (fileName.right(4)!=".rtf" ) fileName+=".rtf"; startPlainFile(fileName); + setRelativePath(m_relPath); + setSourceFileName(stripPath(fileName)); beginRTFDocument(); } @@ -367,6 +379,7 @@ void RTFGenerator::endFile() t << "}"; endPlainFile(); + setSourceFileName(""); } void RTFGenerator::startProjectNumber() @@ -3024,12 +3037,33 @@ void RTFGenerator::endInlineMemberDoc() t << "\\cell }{\\row }" << endl; } -void RTFGenerator::writeLineNumber(const char *,const char *,const char *,int l) +void RTFGenerator::writeLineNumber(const char *ref,const char *fileName,const char *anchor,int l) { + static bool rtfHyperlinks = Config_getBool(RTF_HYPERLINKS); + DoxyCodeLineOpen = TRUE; QCString lineNumber; lineNumber.sprintf("%05d",l); - t << lineNumber << " "; + if (m_prettyCode) + { + if (fileName && !m_sourceFileName.isEmpty() && rtfHyperlinks) + { + QCString lineAnchor; + lineAnchor.sprintf("_l%05d",l); + lineAnchor.prepend(stripExtensionGeneral(m_sourceFileName, ".rtf")); + t << "{\\bkmkstart "; + t << rtfFormatBmkStr(lineAnchor); + t << "}"; + t << "{\\bkmkend "; + t << rtfFormatBmkStr(lineAnchor); + t << "}" << endl; + } + t << lineNumber << " "; + } + else + { + t << l << " "; + } m_col=0; } void RTFGenerator::startCodeLine(bool) diff --git a/src/rtfgen.h b/src/rtfgen.h index 1750a7b..9330b13 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -32,6 +32,8 @@ class RTFGenerator : public OutputGenerator static void writeStyleSheetFile(QFile &f); static void writeExtensionsFile(QFile &file); + void setRelativePath(const QCString &path); + void setSourceFileName(const QCString &sourceFileName); void enable() { if (m_genStack->top()) m_active=*m_genStack->top(); else m_active=TRUE; } void disable() { m_active=FALSE; } @@ -279,6 +281,7 @@ class RTFGenerator : public OutputGenerator const char *rtf_Code_DepthStyle(); void incrementIndentLevel(); void decrementIndentLevel(); + QCString m_sourceFileName; int m_col; bool m_prettyCode; diff --git a/src/util.cpp b/src/util.cpp index 7a7d56e..4b6729a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6585,6 +6585,7 @@ QCString rtfFormatBmkStr(const char *name) } } + //printf("Name = %s RTF_tag = %s\n",name,(*tag).data()); return *tag; } |