29
29
static const int maxCmdLine = 40960 ;
30
30
31
31
static bool convertMapFile (TextStream &t,const QCString &mapName,const QCString &relPath,
32
- const QCString &context)
32
+ const QCString &context, const QCString &srcFile, int srcLine )
33
33
{
34
34
std::ifstream f = Portable::openInputStream (mapName);
35
35
if (!f.is_open ())
@@ -63,17 +63,22 @@ static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString
63
63
if (y2<y1) { int temp=y2; y2=y1; y1=temp; }
64
64
if (x2<x1) { int temp=x2; x2=x1; x1=temp; }
65
65
66
- t << " <area href=\" " ;
67
66
67
+ bool link = false ;
68
68
if ( isRef )
69
69
{
70
70
// handle doxygen \ref tag URL reference
71
71
72
72
auto parser { createDocParser () };
73
- auto dfAst { createRef ( *parser.get (), url, context ) };
73
+ auto dfAst { createRef ( *parser.get (), url, context, srcFile, srcLine ) };
74
74
auto dfAstImpl = dynamic_cast <const DocNodeAST*>(dfAst.get ());
75
75
const DocRef *df = std::get_if<DocRef>(&dfAstImpl->root );
76
76
t << externalRef (relPath,df->ref (),TRUE );
77
+ if (!df->file ().isEmpty () || !df->anchor ().isEmpty ())
78
+ {
79
+ link = true ;
80
+ t << " <area href=\" " ;
81
+ }
77
82
if (!df->file ().isEmpty ())
78
83
{
79
84
QCString fn = df->file ();
@@ -87,11 +92,16 @@ static bool convertMapFile(TextStream &t,const QCString &mapName,const QCString
87
92
}
88
93
else
89
94
{
95
+ link = true ;
96
+ t << " <area href=\" " ;
90
97
t << url;
91
98
}
92
- t << " \" shape=\" rect\" coords=\" "
93
- << x1 << " ," << y1 << " ," << x2 << " ," << y2 << " \" "
94
- << " alt=\"\" />\n " ;
99
+ if (link)
100
+ {
101
+ t << " \" shape=\" rect\" coords=\" "
102
+ << x1 << " ," << y1 << " ," << x2 << " ," << y2 << " \" "
103
+ << " alt=\"\" />\n " ;
104
+ }
95
105
}
96
106
}
97
107
@@ -204,7 +214,7 @@ static QCString getMscImageMapFromFile(const QCString& inFile, const QCString& /
204
214
return " " ;
205
215
206
216
TextStream t;
207
- convertMapFile (t, outFile, relPath, context);
217
+ convertMapFile (t, outFile, relPath, context, srcFile, srcLine );
208
218
209
219
Dir ().remove (outFile.str ());
210
220
0 commit comments