From 022dfa0527cc79a597a7b06db87dcb2f8b19eca7 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 21 Mar 2020 12:38:01 +0100 Subject: issue #7652 folder in file list has file icon (#7654) When a directory has no source files or sub-directories in it (with the exception of markdown file(s)) the directory is seen as a file withe a definition type `TypeDir` but this was not handled properly on output, should have a closed folder icon. --- src/ftvhelp.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 &nl,int level,in char icon=compoundIcon(dynamic_cast(n->def)); t << "" << icon << ""; } + else if (n->def && n->def->definitionType()==Definition::TypeDir) + { + t << ""; + } else { t << ""; -- cgit v0.12 From d165a89863eab073702afb0e19b44cf2e85f7db5 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 21 Mar 2020 12:41:37 +0100 Subject: Incorrect link generated for cite and xref (#7648) Incorrect links were generated for the cite and xref commands, the link text was not translated to a RTF link label. --- src/rtfdocvisitor.cpp | 34 +++++++++++++++++++++++++--------- src/util.cpp | 1 + 2 files changed, 26 insertions(+), 9 deletions(-) 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/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; } -- cgit v0.12 From f788f684f055c5470d624f3c27c6e236f18c2c31 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 21 Mar 2020 16:16:50 +0100 Subject: Missing anchors in RTF code output (#7647) When having the RTF_SOURCE_CODE and RTF_HYPERLINKS set the links to the code are generated (e.g. in "Definition at line") but the corresponding anchor is missing. The corresponding anchors are created (in a similar way as it is done for LaTeX). --- src/rtfgen.cpp | 38 ++++++++++++++++++++++++++++++++++++-- src/rtfgen.h | 3 +++ 2 files changed, 39 insertions(+), 2 deletions(-) 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; -- cgit v0.12 From 7c3b332d233965544467f5e84e249e5985587cb2 Mon Sep 17 00:00:00 2001 From: Jun Tajima <56220423+tjmprm77@users.noreply.github.com> Date: Sun, 22 Mar 2020 01:07:43 +0900 Subject: Fix the problem character string between '<' and '>' is not output in doxywizard log. (#7631) Add the escape processing for strings passed to m_outputLog->append() in MainWindow::readStdout(). --- addon/doxywizard/doxywizard.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 } } } -- cgit v0.12