Skip to content

Commit 53a527a

Browse files
committed
Merge branch 'master' into feature/bug_dw_generator
# Conflicts: # addon/doxywizard/expert.cpp
2 parents 24818c0 + f6490f7 commit 53a527a

16 files changed

Lines changed: 307 additions & 149 deletions

addon/doxywizard/expert.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -774,17 +774,19 @@ QString Expert::getDocsForNode(const QDomElement &child) const
774774
QString docs = SA("");
775775
// read documentation text
776776
QDomElement docsVal = child.firstChildElement();
777+
bool first = true;
777778
while (!docsVal.isNull())
778779
{
779780
if (docsVal.tagName()==SA("docs") &&
780781
docsVal.attribute(SA("doxywizard")) != SA("0"))
781782
{
783+
if (!first) docs += SA("<br/>");
784+
first = false;
782785
for (QDomNode n = docsVal.firstChild(); !n.isNull(); n = n.nextSibling())
783786
{
784787
QDomText t = n.toText();
785788
if (!t.isNull()) docs+=t.data();
786789
}
787-
docs += SA("<br/>");
788790
}
789791
docsVal = docsVal.nextSiblingElement();
790792
}
@@ -835,12 +837,11 @@ QString Expert::getDocsForNode(const QDomElement &child) const
835837
}
836838
if (child.attribute(SA("defval")) != SA(""))
837839
{
838-
docs+=SA("<br/>");
840+
if (!docs.endsWith(SA("<br/>"))) docs += SA("<br/>");
839841
docs+=SA("<br/>");
840842
QString defval = child.attribute(SA("defval"));
841843
docs+=SA(" ")+m_messages[SA("defvalcode")].arg(defval);
842844
}
843-
docs+= SA("<br/>");
844845
}
845846
else if (type==SA("int"))
846847
{
@@ -850,7 +851,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
850851
QString maxval = child.attribute(SA("maxval"));
851852
QString defval = child.attribute(SA("defval"));
852853
docs+=m_messages[SA("minmaxdef")].arg(minval).arg(maxval).arg(defval);
853-
docs+= SA("<br/>");
854854
}
855855
else if (type==SA("bool"))
856856
{
@@ -866,7 +866,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
866866
QString valStr = (defval==SA("1")?SA("YES"):SA("NO"));
867867
docs+=SA(" ")+m_messages[SA("defvalcode")].arg(valStr);
868868
}
869-
docs+= SA("<br/>");
870869
}
871870
else if (type==SA("list"))
872871
{
@@ -929,7 +928,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
929928
docsVal = docsVal.nextSiblingElement();
930929
}
931930
}
932-
// docs+= SA("<br/>");
933931
}
934932
}
935933
else if (type==SA("string"))
@@ -942,7 +940,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
942940
if (!docs.endsWith(SA("<br/>"))) docs += SA("<br/>");
943941
docs+=SA("<br/>");
944942
docs += SA(" ")+m_messages[SA("defdir")].arg(defval);
945-
docs += SA("<br/>");
946943
}
947944
}
948945
else if (child.attribute(SA("format")) == SA("file"))
@@ -960,7 +957,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
960957
{
961958
docs += SA(" ")+m_messages[SA("deffilecode")].arg(defval);
962959
}
963-
docs += SA("<br/>");
964960
}
965961
else
966962
{
@@ -969,7 +965,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
969965
if (!docs.endsWith(SA("<br/>"))) docs += SA("<br/>");
970966
docs+=SA("<br/>");
971967
docs += SA(" ")+m_messages[SA("deffilefull")];
972-
docs += SA("<br/>");
973968
}
974969
}
975970
}
@@ -988,7 +983,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
988983
{
989984
docs += SA(" ")+m_messages[SA("defimgabs")].arg(defval);
990985
}
991-
docs += SA("<br/>");
992986
}
993987
else
994988
{
@@ -997,7 +991,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
997991
if (!docs.endsWith(SA("<br/>"))) docs += SA("<br/>");
998992
docs+=SA("<br/>");
999993
docs += SA(" ")+m_messages[SA("defimgfull")];
1000-
docs += SA("<br/>");
1001994
}
1002995
}
1003996
}
@@ -1008,7 +1001,6 @@ QString Expert::getDocsForNode(const QDomElement &child) const
10081001
if (!docs.endsWith(SA("<br/>"))) docs += SA("<br/>");
10091002
docs+=SA("<br/>");
10101003
docs += SA(" ")+m_messages[SA("defvalcode")].arg(defval);
1011-
docs += SA("<br/>");
10121004
}
10131005
}
10141006
}

src/dotfilepatcher.cpp

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
// top part of the interactive SVG header
3030
static const char svgZoomHeader0[] = R"svg(
31-
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
31+
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
3232
)svg";
3333

3434
static const char svgZoomHeader0_noinit[] = R"svg(
@@ -83,13 +83,13 @@ static const char svgZoomHeader2[] = R"svg(
8383
static const char svgZoomFooter1[] = R"svg(
8484
<g id="navigator" transform="translate(0 0)" fill="#404254">
8585
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
86-
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
87-
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
88-
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
89-
<use id="arrowup" xlink:href="#arrowUp" x="0" y="0" onmousedown="handlePan(0,-1)"/>
90-
<use id="arrowright" xlink:href="#arrowRight" x="0" y="0" onmousedown="handlePan(1,0)"/>
91-
<use id="arrowdown" xlink:href="#arrowDown" x="0" y="0" onmousedown="handlePan(0,1)"/>
92-
<use id="arrowleft" xlink:href="#arrowLeft" x="0" y="0" onmousedown="handlePan(-1,0)"/>
86+
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" data-zoom="in"/>
87+
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" data-zoom="out"/>
88+
<use id="reset" xlink:href="#resetDef" x="30" y="36" data-reset="true"/>
89+
<use id="arrowup" xlink:href="#arrowUp" x="0" y="0" data-pan-x="0" data-pan-y="-1"/>
90+
<use id="arrowright" xlink:href="#arrowRight" x="0" y="0" data-pan-x="1" data-pan-y="0"/>
91+
<use id="arrowdown" xlink:href="#arrowDown" x="0" y="0" data-pan-x="0" data-pan-y="1"/>
92+
<use id="arrowleft" xlink:href="#arrowLeft" x="0" y="0" data-pan-x="-1" data-pan-y="0"/>
9393
</g>
9494
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
9595
<g id="arrow_out" transform="scale(0.3 0.3)">
@@ -112,12 +112,6 @@ static const char svgZoomFooter2[] = R"svg(
112112
[data-mouse-over-selected='true'] { opacity: 1.0; }
113113
]]>
114114
</style>
115-
<script type="application/ecmascript"><![CDATA[
116-
document.addEventListener('DOMContentLoaded', (event) => {
117-
highlightEdges();
118-
highlightAdjacentNodes();
119-
});
120-
]]></script>
121115
</svg>
122116
)svg";
123117

@@ -390,19 +384,17 @@ bool DotFilePatcher::run() const
390384
{
391385
t << svgZoomHeader2;
392386
}
387+
t << "<script type=\"application/ecmascript\" xlink:href=\"" << relPath << "svg.min.js\"/>\n";
388+
t << "<svg id=\"graph\" class=\"graph\"";
393389
if (useNagivation)
394390
{
395-
t << "<script type=\"application/ecmascript\">\n";
396-
t << "var viewWidth = " << width << ";\n";
397-
t << "var viewHeight = " << height << ";\n";
391+
t << " data-view-width=\"" << width << "\" data-view-height=\"" << height << "\"";
398392
if (graphId>=0)
399393
{
400-
t << "var sectionId = 'dynsection-" << graphId << "';\n";
394+
t << " data-section-id=\"dynsection-" << graphId << "\"";
401395
}
402-
t << "</script>\n";
403396
}
404-
t << "<script type=\"application/ecmascript\" xlink:href=\"" << relPath << "svg.min.js\"/>\n";
405-
t << "<svg id=\"graph\" class=\"graph\">\n";
397+
t << ">\n";
406398

407399
if (useNagivation)
408400
{

src/dotrunner.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,15 @@ bool DotRunner::run(const DotJobs &dotJobs)
397397
{
398398
if (cmd.numDotFiles>0)
399399
{
400-
auto process = [this,cmd,dirStr]() -> size_t
400+
auto locDirStr = dirStr;
401+
auto process = [this,cmd,locDirStr]() -> size_t
401402
{
402403
int exitCode;
403404
if ((exitCode = Portable::system(m_dotExe, cmd.arguments, FALSE)) != 0)
404405
{
405406
err_full(cmd.firstJob->srcFile, 1,
406407
"Problems running dot: exit code={}, command='{}', dir='{}', arguments='{}'",
407-
exitCode, m_dotExe, dirStr, cmd.arguments);
408+
exitCode, m_dotExe, locDirStr, cmd.arguments);
408409
}
409410
return cmd.numDotFiles;
410411
};

src/ftvhelp.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,13 @@ static void generateIndent(TextStream &t, const FTVNodePtr &n,bool opened)
268268
const char *ARROW_DOWN = "<span class=\"arrowhead opened\"></span>";
269269
const char *ARROW_RIGHT = "<span class=\"arrowhead closed\"></span>";
270270
QCString dir = opened ? ARROW_DOWN : ARROW_RIGHT;
271-
t << "<span style=\"width:" << (indent*16) << "px;display:inline-block;\">&#160;</span>"
272-
<< "<span id=\"arr_" << generateIndentLabel(n,0) << "\" class=\"arrow\" ";
273-
t << "onclick=\"dynsection.toggleFolder('" << generateIndentLabel(n,0) << "')\"";
274-
t << ">" << dir
271+
for(int i=0;i<indent;i++) t << "<span class=\"spacer\">&#160;</span>";
272+
t << "<span id=\"arr_" << generateIndentLabel(n,0) << "\" class=\"arrow\">" << dir
275273
<< "</span>";
276274
}
277275
else
278276
{
279-
t << "<span style=\"width:" << ((indent+1)*16) << "px;display:inline-block;\">&#160;</span>";
277+
for(int i=0;i<=indent;i++) t << "<span class=\"spacer\">&#160;</span>";
280278
}
281279
}
282280

@@ -383,14 +381,16 @@ void FTVHelp::Private::generateTree(TextStream &t, const FTVNodes &nl,int level,
383381
for (const auto &n : nl)
384382
{
385383
t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\"";
384+
t << " class=\"";
386385
if ((index&1)==0) // even row
387-
t << " class=\"even\"";
386+
t << "even";
388387
else
389-
t << " class=\"odd\"";
388+
t << "odd";
390389
if (level>=maxLevel && dynamicSections) // item invisible by default
391-
t << " style=\"display:none;\"";
390+
t << " hidden";
392391
else // item visible by default
393392
index++;
393+
t << "\"";
394394
t << "><td class=\"entry\">";
395395
bool nodeOpened = level+1<maxLevel;
396396
generateIndent(t,n,nodeOpened);
@@ -430,9 +430,8 @@ void FTVHelp::Private::generateTree(TextStream &t, const FTVNodes &nl,int level,
430430
}
431431
else if (dynamicSections)
432432
{
433-
t << "<span id=\"img_" << generateIndentLabel(n,0) << "\" class=\"iconfolder"
434-
<< "\" onclick=\"dynsection.toggleFolder('" << generateIndentLabel(n,0)
435-
<< "')\"><div class=\"folder-icon"
433+
t << "<span id=\"img_" << generateIndentLabel(n,0) << "\" class=\"iconfolder\">"
434+
<< "<div class=\"folder-icon"
436435
<< (nodeOpened ? " open" : "")
437436
<< "\"></div></span>";
438437
}
@@ -903,7 +902,7 @@ void FTVHelp::generateTreeViewInline(TextStream &t)
903902
t << " ";
904903
for (int i=1;i<=depth;i++)
905904
{
906-
t << "<span onclick=\"javascript:dynsection.toggleLevel(" << i << ");\">" << i << "</span>";
905+
t << "<span class=\"dyn-level-" << i << "\">" << i << "</span>";
907906
}
908907
t << "]</div>";
909908
}

src/htmldocvisitor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void HtmlDocVisitor::writeObfuscatedMailAddress(const QCString &url)
329329
}
330330
else
331331
{
332-
m_t << "<a href=\"#\" onclick=\"location.href='mai'+'lto:'";
332+
m_t << "<a href=\"mai'+'lto:";
333333
if (!url.isEmpty())
334334
{
335335
const char *p = url.data();
@@ -345,7 +345,7 @@ void HtmlDocVisitor::writeObfuscatedMailAddress(const QCString &url)
345345
if (size==3) size=2; else size=3;
346346
}
347347
}
348-
m_t << "; return false;\">";
348+
m_t << "\">";
349349
}
350350
}
351351

0 commit comments

Comments
 (0)