Skip to content

Commit a7018a6

Browse files
committed
Show "Additional Inherited Members" for LaTeX, RTF, etc.
For the HTML output we see a wit the "Additional Inherited Members" we see (in the expandable list) all the additional inherited members, with LaTeX, RTF etc. we only see the header but no members. (Seen with the example code from issue #9678)
1 parent 3a8b6b5 commit a7018a6

12 files changed

+208
-95
lines changed

Diff for: src/classdef.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -4446,8 +4446,6 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
44464446
MemberListType lt,int lt2,const QCString &title,
44474447
const ClassDef *inheritedFrom,bool invert,bool showAlways) const
44484448
{
4449-
ol.pushGeneratorState();
4450-
ol.disableAllBut(OutputType::Html);
44514449
int count = countMembersIncludingGrouped(lt,inheritedFrom,FALSE);
44524450
bool process = count>0;
44534451
//printf("%s: writeInheritedMemberDec: lt=%d process=%d invert=%d always=%d\n",
@@ -4482,7 +4480,6 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &
44824480
}
44834481
}
44844482
}
4485-
ol.popGeneratorState();
44864483
}
44874484

44884485
void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,

Diff for: src/docbookgen.cpp

+23-7
Original file line numberDiff line numberDiff line change
@@ -672,21 +672,29 @@ void DocbookGenerator::docify(const QCString &str)
672672
DB_GEN_C
673673
m_t << convertToDocBook(str);
674674
}
675-
void DocbookGenerator::writeObjectLink(const QCString &, const QCString &f,
676-
const QCString &anchor, const QCString &text)
675+
QCString DocbookGenerator::objectLinkToString(const QCString &, const QCString &f,
676+
const QCString &anchor, const QCString &text)
677677
{
678678
DB_GEN_C
679+
QCString result;
679680
if (!anchor.isEmpty())
680681
{
681-
if (!f.isEmpty()) m_t << "<link linkend=\"_" << stripPath(f) << "_1" << anchor << "\">";
682-
else m_t << "<link linkend=\"_" << anchor << "\">";
682+
if (!f.isEmpty()) result += "<link linkend=\"_" + stripPath(f) + "_1" + anchor + "\">";
683+
else result += "<link linkend=\"_" + anchor + "\">";
683684
}
684685
else
685686
{
686-
m_t << "<link linkend=\"_" << stripPath(f) << "\">";
687+
result += "<link linkend=\"_" + stripPath(f) + "\">";
687688
}
688-
docify(text);
689-
m_t << "</link>";
689+
result += convertToDocBook(text);
690+
result += "</link>";
691+
return result;
692+
}
693+
void DocbookGenerator::writeObjectLink(const QCString &ref, const QCString &f,
694+
const QCString &anchor, const QCString &text)
695+
{
696+
DB_GEN_C
697+
m_t << objectLinkToString(ref,f,anchor,text);
690698
}
691699
void DocbookGenerator::startMemberList()
692700
{
@@ -1257,3 +1265,11 @@ void DocbookGenerator::closeAllSections()
12571265
}
12581266
}
12591267

1268+
void DocbookGenerator::writeInheritedSectionTitle(
1269+
const QCString &id, const QCString &ref,
1270+
const QCString &file, const QCString &anchor,
1271+
const QCString &title, const QCString &name)
1272+
{
1273+
DB_GEN_C
1274+
m_t << theTranslator->trInheritedFrom(convertToDocBook(title), objectLinkToString(ref, file, anchor, name));
1275+
}

Diff for: src/docbookgen.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class DocbookGenerator : public OutputGenerator //: public CodeOutputForwarder<O
139139
void writeString(const QCString &);
140140
void startParagraph(const QCString &);
141141
void endParagraph();
142+
QCString objectLinkToString(const QCString &,const QCString &,const QCString &,const QCString &);
142143
void writeObjectLink(const QCString &,const QCString &,const QCString &,const QCString &);
143144
void startHtmlLink(const QCString &){DB_GEN_NEW};
144145
void endHtmlLink(){DB_GEN_NEW};
@@ -238,7 +239,7 @@ class DocbookGenerator : public OutputGenerator //: public CodeOutputForwarder<O
238239
void endMemberDeclaration(const QCString &,const QCString &){DB_GEN_EMPTY};
239240
void writeInheritedSectionTitle(const QCString &,const QCString &,
240241
const QCString &,const QCString &,
241-
const QCString &,const QCString &){DB_GEN_NEW};
242+
const QCString &,const QCString &);
242243
void startIndent(){DB_GEN_EMPTY};
243244
void endIndent(){DB_GEN_EMPTY};
244245
void writeSynopsis(){DB_GEN_EMPTY};

Diff for: src/htmlgen.cpp

+45-25
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,11 @@ void HtmlCodeGenerator::codify(const QCString &str)
761761
}
762762
}
763763

764-
void HtmlCodeGenerator::docify(const QCString &str)
764+
static QCString docifyToString(const QCString &str)
765765
{
766-
//m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(str));
766+
QCString result;
767+
768+
//result+= getHtmlDirEmbeddingChar(getTextDirByConfig(str));
767769

768770
if (!str.isEmpty())
769771
{
@@ -774,38 +776,47 @@ void HtmlCodeGenerator::docify(const QCString &str)
774776
c=*p++;
775777
switch(c)
776778
{
777-
case '<': m_t << "&lt;"; break;
778-
case '>': m_t << "&gt;"; break;
779-
case '&': m_t << "&amp;"; break;
780-
case '"': m_t << "&quot;"; break;
779+
case '<': result+= "&lt;"; break;
780+
case '>': result+= "&gt;"; break;
781+
case '&': result+= "&amp;"; break;
782+
case '"': result+= "&quot;"; break;
781783
case '\\':
782784
if (*p=='<')
783-
{ m_t << "&lt;"; p++; }
785+
{ result+= "&lt;"; p++; }
784786
else if (*p=='>')
785-
{ m_t << "&gt;"; p++; }
787+
{ result+= "&gt;"; p++; }
786788
else if (*p=='(')
787-
{ m_t << "\\&zwj;("; p++; }
789+
{ result+= "\\&zwj;("; p++; }
788790
else if (*p==')')
789-
{ m_t << "\\&zwj;)"; p++; }
791+
{ result+= "\\&zwj;)"; p++; }
790792
else
791-
m_t << "\\";
793+
result+= "\\";
792794
break;
793795
default:
794796
{
795797
uchar uc = static_cast<uchar>(c);
796798
if (uc<32 && !isspace(c))
797799
{
798-
m_t << "&#x24" << hex[uc>>4] << hex[uc&0xF] << ";";
800+
result+= "&#x24";
801+
result+= hex[uc>>4];
802+
result+= hex[uc&0xF];
803+
result+= ";";
799804
}
800805
else
801806
{
802-
m_t << c;
807+
result+= c;
803808
}
804809
}
805810
break;
806811
}
807812
}
808813
}
814+
return result;
815+
}
816+
817+
void HtmlCodeGenerator::docify(const QCString &str)
818+
{
819+
m_t << docifyToString(str);
809820
}
810821

811822
void HtmlCodeGenerator::writeLineNumber(const QCString &ref,const QCString &filename,
@@ -1612,25 +1623,34 @@ void HtmlGenerator::writeStartAnnoItem(const QCString &,const QCString &f,
16121623
m_t << "</a> ";
16131624
}
16141625

1615-
void HtmlGenerator::writeObjectLink(const QCString &ref,const QCString &f,
1616-
const QCString &anchor, const QCString &name)
1626+
QCString HtmlGenerator::objectLinkToString(const QCString &ref,const QCString &f,
1627+
const QCString &anchor, const QCString &name)
16171628
{
1629+
QCString result;
1630+
16181631
if (!ref.isEmpty())
16191632
{
1620-
m_t << "<a class=\"elRef\" ";
1621-
m_t << externalLinkTarget();
1633+
result += "<a class=\"elRef\" ";
1634+
result += externalLinkTarget();
16221635
}
16231636
else
16241637
{
1625-
m_t << "<a class=\"el\" ";
1638+
result += "<a class=\"el\" ";
16261639
}
1627-
m_t << "href=\"";
1628-
m_t << externalRef(m_relPath,ref,TRUE);
1629-
if (!f.isEmpty()) m_t << addHtmlExtensionIfMissing(f);
1630-
if (!anchor.isEmpty()) m_t << "#" << anchor;
1631-
m_t << "\">";
1632-
docify(name);
1633-
m_t << "</a>";
1640+
result += "href=\"";
1641+
result += externalRef(m_relPath,ref,TRUE);
1642+
if (!f.isEmpty()) result += addHtmlExtensionIfMissing(f);
1643+
if (!anchor.isEmpty()) result += "#" + anchor;
1644+
result += "\">";
1645+
result += docifyToString(name);
1646+
result += "</a>";
1647+
return result;
1648+
}
1649+
1650+
void HtmlGenerator::writeObjectLink(const QCString &ref,const QCString &f,
1651+
const QCString &anchor, const QCString &name)
1652+
{
1653+
m_t << objectLinkToString(ref,f,anchor,name);
16341654
}
16351655

16361656
void HtmlGenerator::startTextLink(const QCString &f,const QCString &anchor)

Diff for: src/htmlgen.h

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class HtmlGenerator : public OutputGenerator //public CodeOutputForwarder<Output
123123
void endIndexItem(const QCString &ref,const QCString &file);
124124
void docify(const QCString &text);
125125

126+
QCString objectLinkToString(const QCString &ref,const QCString &file,
127+
const QCString &anchor,const QCString &name);
126128
void writeObjectLink(const QCString &ref,const QCString &file,
127129
const QCString &anchor,const QCString &name);
128130

Diff for: src/latexgen.cpp

+36-12
Original file line numberDiff line numberDiff line change
@@ -1263,26 +1263,33 @@ void LatexGenerator::endTextLink()
12631263
m_t << "}";
12641264
}
12651265

1266-
void LatexGenerator::writeObjectLink(const QCString &ref, const QCString &f,
1267-
const QCString &anchor, const QCString &text)
1266+
QCString LatexGenerator::objectLinkToString(const QCString &ref, const QCString &f,
1267+
const QCString &anchor, const QCString &text)
12681268
{
12691269
bool pdfHyperlinks = Config_getBool(PDF_HYPERLINKS);
1270+
QCString result;
12701271
if (!m_disableLinks && ref.isEmpty() && pdfHyperlinks)
12711272
{
1272-
m_t << "\\mbox{\\hyperlink{";
1273-
if (!f.isEmpty()) m_t << stripPath(f);
1274-
if (!f.isEmpty() && !anchor.isEmpty()) m_t << "_";
1275-
if (!anchor.isEmpty()) m_t << anchor;
1276-
m_t << "}{";
1277-
docify(text);
1278-
m_t << "}}";
1273+
result += "\\mbox{\\hyperlink{";
1274+
if (!f.isEmpty()) result += stripPath(f);
1275+
if (!f.isEmpty() && !anchor.isEmpty()) result += "_";
1276+
if (!anchor.isEmpty()) result += anchor;
1277+
result += "}{";
1278+
result += convertToLaTeX(text);
1279+
result += "}}";
12791280
}
12801281
else
12811282
{
1282-
m_t << "\\textbf{ ";
1283-
docify(text);
1284-
m_t << "}";
1283+
result += "\\textbf{ ";
1284+
result += convertToLaTeX(text);
1285+
result += "}";
12851286
}
1287+
return result;
1288+
}
1289+
void LatexGenerator::writeObjectLink(const QCString &ref, const QCString &f,
1290+
const QCString &anchor, const QCString &text)
1291+
{
1292+
m_t << objectLinkToString(ref,f,anchor,text);
12861293
}
12871294

12881295
void LatexGenerator::startPageRef()
@@ -2135,3 +2142,20 @@ void LatexGenerator::writeLabel(const QCString &l,bool isLast)
21352142
void LatexGenerator::endLabels()
21362143
{
21372144
}
2145+
2146+
void LatexGenerator::writeInheritedSectionTitle(
2147+
const QCString &id, const QCString &ref,
2148+
const QCString &file, const QCString &anchor,
2149+
const QCString &title, const QCString &name)
2150+
{
2151+
if (Config_getBool(COMPACT_LATEX))
2152+
{
2153+
m_t << "\\doxyparagraph*{";
2154+
}
2155+
else
2156+
{
2157+
m_t << "\\doxysubsubsection*{";
2158+
}
2159+
m_t << theTranslator->trInheritedFrom(convertToLaTeX(title), objectLinkToString(ref, file, anchor, name));
2160+
m_t << "}\n";
2161+
}

Diff for: src/latexgen.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ class LatexGenerator : public OutputGenerator //: public CodeOutputForwarder<Out
132132
void startIndexItem(const QCString &ref,const QCString &file);
133133
void endIndexItem(const QCString &ref,const QCString &file);
134134
void docify(const QCString &text);
135+
QCString objectLinkToString(const QCString &ref,const QCString &file,
136+
const QCString &anchor,const QCString &name);
135137
void writeObjectLink(const QCString &ref,const QCString &file,
136138
const QCString &anchor,const QCString &name);
137139

@@ -212,7 +214,7 @@ class LatexGenerator : public OutputGenerator //: public CodeOutputForwarder<Out
212214
void startMemberDeclaration() {}
213215
void endMemberDeclaration(const QCString &,const QCString &) {}
214216
void writeInheritedSectionTitle(const QCString &,const QCString &,const QCString &,
215-
const QCString &,const QCString &,const QCString &) {}
217+
const QCString &,const QCString &,const QCString &);
216218
void startDescList(SectionTypes) { m_t << "\\begin{Desc}\n\\item["; }
217219
void endDescList() { m_t << "\\end{Desc}\n"; }
218220
void startExamples();

Diff for: src/mangen.cpp

+33-9
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,20 @@ void ManGenerator::writeStartAnnoItem(const QCString &,const QCString &,
316316
{
317317
}
318318

319-
void ManGenerator::writeObjectLink(const QCString &,const QCString &,
320-
const QCString &, const QCString &name)
319+
QCString ManGenerator::objectLinkToString(const QCString &,const QCString &,
320+
const QCString &, const QCString &name)
321321
{
322-
startBold(); docify(name); endBold();
322+
QCString result;
323+
result += "\\fB";
324+
result += docifyToString(name);
325+
result += "\\fP";
326+
m_firstCol=FALSE;
327+
return result;
328+
}
329+
void ManGenerator::writeObjectLink(const QCString &ref,const QCString &f,
330+
const QCString &anchor, const QCString &text)
331+
{
332+
m_t << objectLinkToString(ref,f,anchor,text);
323333
}
324334

325335
void ManGenerator::startHtmlLink(const QCString &)
@@ -359,8 +369,9 @@ void ManGenerator::endMemberHeader()
359369
m_paragraph=FALSE;
360370
}
361371

362-
void ManGenerator::docify(const QCString &str)
372+
QCString ManGenerator::docifyToString(const QCString &str)
363373
{
374+
QCString result;
364375
if (!str.isEmpty())
365376
{
366377
const char *p=str.data();
@@ -369,18 +380,23 @@ void ManGenerator::docify(const QCString &str)
369380
{
370381
switch(c)
371382
{
372-
case '-': m_t << "\\-"; break; // see bug747780
373-
case '.': m_t << "\\&."; break; // see bug652277
374-
case '\\': m_t << "\\\\"; m_col++; break;
375-
case '\n': m_t << "\n"; m_col=0; break;
383+
case '-': result += "\\-"; break; // see bug747780
384+
case '.': result += "\\&."; break; // see bug652277
385+
case '\\': result += "\\\\"; m_col++; break;
386+
case '\n': result += "\n"; m_col=0; break;
376387
case '\"': c = '\''; // no break!
377-
default: m_t << c; m_col++; break;
388+
default: result += c; m_col++; break;
378389
}
379390
}
380391
m_firstCol=(c=='\n');
381392
//printf("%s",str);fflush(stdout);
382393
}
383394
m_paragraph=FALSE;
395+
return result;
396+
}
397+
void ManGenerator::docify(const QCString &str)
398+
{
399+
m_t << docifyToString(str);
384400
}
385401

386402
void ManGenerator::writeChar(char c)
@@ -866,3 +882,11 @@ void ManGenerator::endHeaderSection()
866882
{
867883
}
868884

885+
void ManGenerator::writeInheritedSectionTitle(
886+
const QCString &id, const QCString &ref,
887+
const QCString &file, const QCString &anchor,
888+
const QCString &title, const QCString &name)
889+
{
890+
m_t << "\n\n";
891+
m_t << theTranslator->trInheritedFrom(docifyToString(title), objectLinkToString(ref, file, anchor, name));
892+
}

Diff for: src/mangen.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ class ManGenerator : public OutputGenerator //public CodeOutputForwarder<OutputG
104104
void endItemList() { newParagraph(); }
105105
void startIndexItem(const QCString &ref,const QCString &file);
106106
void endIndexItem(const QCString &ref,const QCString &file);
107+
QCString docifyToString(const QCString &text);
107108
void docify(const QCString &text);
109+
QCString objectLinkToString(const QCString &ref,const QCString &file,
110+
const QCString &anchor,const QCString &name);
108111
void writeObjectLink(const QCString &ref,const QCString &file,
109112
const QCString &anchor,const QCString &name);
110113
void startTextLink(const QCString &,const QCString &) {}
@@ -182,7 +185,7 @@ class ManGenerator : public OutputGenerator //public CodeOutputForwarder<OutputG
182185
void startMemberDeclaration() {}
183186
void endMemberDeclaration(const QCString &,const QCString &) {}
184187
void writeInheritedSectionTitle(const QCString &,const QCString &,const QCString &,
185-
const QCString &,const QCString &,const QCString &) {}
188+
const QCString &,const QCString &,const QCString &);
186189
void startDescList(SectionTypes);
187190
void endDescList() {}
188191
void startExamples();

0 commit comments

Comments
 (0)