@@ -890,11 +890,16 @@ void HtmlCodeGenerator::_writeCodeLink(const QCString &className,
890
890
*m_t << " <a class=\" " << className << " \" " ;
891
891
}
892
892
*m_t << " href=\" " ;
893
- *m_t << externalRef (m_relPath,ref,TRUE );
893
+ if (!ref. isEmpty ()) *m_t << externalRef (m_relPath,ref,TRUE );
894
894
if (!f.isEmpty ())
895
895
{
896
896
QCString fn = f;
897
897
addHtmlExtensionIfMissing (fn);
898
+ if (ref.isEmpty ())
899
+ {
900
+ if (!anchor.isEmpty () && (fileName () == fn)) fn = " " ;
901
+ else *m_t << externalRef (m_relPath,ref,TRUE );
902
+ }
898
903
*m_t << fn;
899
904
}
900
905
if (!anchor.isEmpty ()) *m_t << " #" << anchor;
@@ -918,7 +923,12 @@ void HtmlCodeGenerator::writeTooltip(const QCString &id, const DocLinkInfo &docI
918
923
if (!docInfo.url .isEmpty ())
919
924
{
920
925
*m_t << " <a href=\" " ;
921
- *m_t << externalRef (m_relPath,docInfo.ref ,TRUE );
926
+ if (!docInfo.ref .isEmpty ()) *m_t << externalRef (m_relPath,docInfo.ref ,TRUE );
927
+ else
928
+ {
929
+ if (!docInfo.anchor .isEmpty () && (fileName () == url)) url = " " ;
930
+ else *m_t << externalRef (m_relPath,docInfo.ref ,TRUE );
931
+ }
922
932
*m_t << url;
923
933
if (!docInfo.anchor .isEmpty ())
924
934
{
@@ -932,18 +942,21 @@ void HtmlCodeGenerator::writeTooltip(const QCString &id, const DocLinkInfo &docI
932
942
*m_t << " </a>" ;
933
943
}
934
944
*m_t << " </div>" ;
945
+
935
946
if (!decl.isEmpty ())
936
947
{
937
948
*m_t << " <div class=\" ttdeci\" >" ;
938
949
docify (decl);
939
950
*m_t << " </div>" ;
940
951
}
952
+
941
953
if (!desc.isEmpty ())
942
954
{
943
955
*m_t << " <div class=\" ttdoc\" >" ;
944
956
docify (desc);
945
957
*m_t << " </div>" ;
946
958
}
959
+
947
960
if (!defInfo.file .isEmpty ())
948
961
{
949
962
*m_t << " <div class=\" ttdef\" ><b>" << theTranslator->trDefinition () << " </b> " ;
@@ -952,7 +965,12 @@ void HtmlCodeGenerator::writeTooltip(const QCString &id, const DocLinkInfo &docI
952
965
url = defInfo.url ;
953
966
addHtmlExtensionIfMissing (url);
954
967
*m_t << " <a href=\" " ;
955
- *m_t << externalRef (m_relPath,defInfo.ref ,TRUE );
968
+ if (!defInfo.ref .isEmpty ()) *m_t << externalRef (m_relPath,defInfo.ref ,TRUE );
969
+ else
970
+ {
971
+ if (!defInfo.anchor .isEmpty () && (fileName () == url)) url = " " ;
972
+ else *m_t << externalRef (m_relPath,defInfo.ref ,TRUE );
973
+ }
956
974
*m_t << url;
957
975
if (!defInfo.anchor .isEmpty ())
958
976
{
@@ -975,7 +993,12 @@ void HtmlCodeGenerator::writeTooltip(const QCString &id, const DocLinkInfo &docI
975
993
url = declInfo.url ;
976
994
addHtmlExtensionIfMissing (url);
977
995
*m_t << " <a href=\" " ;
978
- *m_t << externalRef (m_relPath,declInfo.ref ,TRUE );
996
+ if (!declInfo.ref .isEmpty ()) *m_t << externalRef (m_relPath,declInfo.ref ,TRUE );
997
+ else
998
+ {
999
+ if (!declInfo.anchor .isEmpty () && (fileName () == url)) url = " " ;
1000
+ else *m_t << externalRef (m_relPath,declInfo.ref ,TRUE );
1001
+ }
979
1002
*m_t << url;
980
1003
if (!declInfo.anchor .isEmpty ())
981
1004
{
@@ -1424,6 +1447,7 @@ void HtmlGenerator::startFile(const QCString &name,const QCString &,
1424
1447
m_lastTitle=title;
1425
1448
1426
1449
startPlainFile (fileName);
1450
+ m_codeGen->setFileName (fileName);
1427
1451
m_codeGen->setRelativePath (m_relPath);
1428
1452
{
1429
1453
std::lock_guard<std::mutex> lock (g_indexLock);
@@ -1723,11 +1747,16 @@ void HtmlGenerator::writeObjectLink(const QCString &ref,const QCString &f,
1723
1747
m_t << " <a class=\" el\" " ;
1724
1748
}
1725
1749
m_t << " href=\" " ;
1726
- m_t << externalRef (m_relPath,ref,TRUE );
1750
+ if (!ref. isEmpty ()) m_t << externalRef (m_relPath,ref,TRUE );
1727
1751
if (!f.isEmpty ())
1728
1752
{
1729
1753
QCString fn = f;
1730
1754
addHtmlExtensionIfMissing (fn);
1755
+ if (ref.isEmpty ())
1756
+ {
1757
+ if (!anchor.isEmpty () && (fileName () == Config_getString (HTML_OUTPUT) + " /" + fn)) fn = " " ;
1758
+ else m_t << externalRef (m_relPath,ref,TRUE );
1759
+ }
1731
1760
m_t << fn;
1732
1761
}
1733
1762
if (!anchor.isEmpty ()) m_t << " #" << anchor;
@@ -1743,7 +1772,7 @@ void HtmlGenerator::startTextLink(const QCString &f,const QCString &anchor)
1743
1772
{
1744
1773
QCString fn = f;
1745
1774
addHtmlExtensionIfMissing (fn);
1746
- m_t << m_relPath << fn;
1775
+ if (anchor. isEmpty () || ( fileName () != Config_getString (HTML_OUTPUT) + " / " + fn)) m_t << m_relPath << fn;
1747
1776
}
1748
1777
if (!anchor.isEmpty ()) m_t << " #" << anchor;
1749
1778
m_t << " \" >" ;
@@ -2551,7 +2580,7 @@ void HtmlGenerator::writeDoc(const IDocNodeAST *ast,const Definition *ctx,const
2551
2580
if (astImpl)
2552
2581
{
2553
2582
m_codeList->setId (id);
2554
- HtmlDocVisitor visitor (m_t ,*m_codeList,ctx);
2583
+ HtmlDocVisitor visitor (m_t ,*m_codeList,ctx, fileName () );
2555
2584
std::visit (visitor,astImpl->root );
2556
2585
}
2557
2586
}
0 commit comments