From e40d6588c22f465d9cdd17a58f089031ebab581b Mon Sep 17 00:00:00 2001 From: avostrik Date: Wed, 1 Apr 2020 20:36:43 +0300 Subject: Fix html file ext in external docs (#7679) * Add HTML extension to url conditionally in tree view item. This change fixes issue with double extension in treeview file list items generated from external tag file. Items that were read from tag file already have extension. * Add missing HTML file extension in writeTagFile() calls * Unify addition of HTML file extension in writeTagFile calls. Signed-off-by: Andrey Vostrikov --- src/doxygen.cpp | 1 + src/filedef.cpp | 2 +- src/ftvhelp.cpp | 2 +- src/memberdef.cpp | 2 +- src/pagedef.cpp | 2 +- src/vhdldocgen.cpp | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 19c7f2c..a5314ae 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -10535,6 +10535,7 @@ static void writeTagFile() << "" << endl << " " << convertToXML(Doxygen::mainPage->getOutputFileBase()) + << Doxygen::htmlFileExtension << "" << endl; mainPage->writeDocAnchorsToTagFile(); diff --git a/src/filedef.cpp b/src/filedef.cpp index a60f4d8..45849dd 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -349,7 +349,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile) tagFile << " " << endl; tagFile << " " << convertToXML(name()) << "" << endl; tagFile << " " << convertToXML(getPath()) << "" << endl; - tagFile << " " << convertToXML(addHtmlExtensionIfMissing(getOutputFileBase())) << "" << endl; + tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; if (m_includeList && m_includeList->count()>0) { QListIterator ili(*m_includeList); diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index c3aac54..cb50af1 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -259,7 +259,7 @@ static QCString node2URL(const FTVNode *n,bool overruleFile=FALSE,bool srcLink=F url = fd->getOutputFileBase(); } } - url+=Doxygen::htmlFileExtension; + url = addHtmlExtensionIfMissing(url); if (!n->anchor.isEmpty()) url+="#"+n->anchor; } return url; diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 6d98311..39b8f70 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -4544,7 +4544,7 @@ void MemberDefImpl::writeTagFile(FTextStream &tagFile) const tagFile << " " << convertToXML(typeString()) << "" << endl; } tagFile << " " << convertToXML(name()) << "" << endl; - tagFile << " " << convertToXML(getOutputFileBase()+Doxygen::htmlFileExtension) << "" << endl; + tagFile << " " << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; tagFile << " " << convertToXML(anchor()) << "" << endl; QCString idStr = id(); if (!idStr.isEmpty()) diff --git a/src/pagedef.cpp b/src/pagedef.cpp index 15d6ca8..011b647 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -162,7 +162,7 @@ void PageDefImpl::writeTagFile(FTextStream &tagFile) tagFile << " " << endl; tagFile << " " << name() << "" << endl; tagFile << " " << convertToXML(title()) << "" << endl; - tagFile << " " << convertToXML(getOutputFileBase()) << "" << endl; + tagFile << " " << convertToXML(getOutputFileBase())<< Doxygen::htmlFileExtension << "" << endl; writeDocAnchorsToTagFile(tagFile); tagFile << " " << endl; } diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 3528627..8b2ac41 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1877,7 +1877,7 @@ void VhdlDocGen::writeTagFile(MemberDef *mdef,FTextStream &tagFile) tagFile << "\">" << endl; tagFile << " " << convertToXML(mdef->typeString()) << "" << endl; tagFile << " " << convertToXML(mdef->name()) << "" << endl; - tagFile << " " << convertToXML(mdef->getOutputFileBase()+Doxygen::htmlFileExtension) << "" << endl; + tagFile << " " << convertToXML(mdef->getOutputFileBase()) << Doxygen::htmlFileExtension << "" << endl; tagFile << " " << convertToXML(mdef->anchor()) << "" << endl; if (VhdlDocGen::isVhdlFunction(mdef)) -- cgit v0.12