Skip to content

Commit 457cc69

Browse files
committed
Only show "More..." link when there is both brief and detailed content
1 parent 49df009 commit 457cc69

File tree

1 file changed

+11
-42
lines changed

1 file changed

+11
-42
lines changed

src/memberdef.cpp

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,12 +2468,9 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
24682468
ol.endAnonTypeScope(--s_indentLevel);
24692469
}
24702470

2471-
// write brief description all but HTML
2472-
ol.pushGeneratorState();
2473-
ol.disable(OutputGenerator::Html);
2471+
// write brief description
24742472
if (!briefDescription().isEmpty() &&
24752473
Config_getBool(BRIEF_MEMBER_DESC)
2476-
/* && !annMemb */
24772474
)
24782475
{
24792476
std::unique_ptr<IDocParser> parser { createDocParser() };
@@ -2487,6 +2484,16 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
24872484
{
24882485
ol.startMemberDescription(anchor(),inheritId);
24892486
ol.writeDoc(rootNode.get(),getOuterScope()?getOuterScope():d,this);
2487+
if (detailsVisible) // add More.. link only when both brief and details are visible
2488+
{
2489+
ol.pushGeneratorState();
2490+
ol.disableAllBut(OutputGenerator::Html);
2491+
ol.docify(" ");
2492+
ol.startTextLink(getOutputFileBase(),anchor());
2493+
ol.parseText(theTranslator->trMore());
2494+
ol.endTextLink();
2495+
ol.popGeneratorState();
2496+
}
24902497
// for RTF we need to add an extra empty paragraph
24912498
ol.pushGeneratorState();
24922499
ol.disableAllBut(OutputGenerator::RTF);
@@ -2496,44 +2503,6 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
24962503
ol.endMemberDescription();
24972504
}
24982505
}
2499-
ol.popGeneratorState();
2500-
2501-
// write brief description HTML
2502-
ol.pushGeneratorState();
2503-
ol.disableAllBut(OutputGenerator::Html);
2504-
if ( Config_getBool(BRIEF_MEMBER_DESC)
2505-
)
2506-
{
2507-
std::unique_ptr<IDocParser> parser { createDocParser() };
2508-
std::unique_ptr<DocRoot> rootNode { validatingParseDoc(*parser.get(),
2509-
briefFile(),briefLine(),
2510-
getOuterScope()?getOuterScope():d,
2511-
this,briefDescription(),TRUE,FALSE,
2512-
QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
2513-
2514-
if (rootNode)
2515-
{
2516-
if (!rootNode->isEmpty() || detailsVisible)
2517-
{ // to prevent empty line i n case both are empty
2518-
ol.startMemberDescription(anchor(),inheritId);
2519-
ol.writeDoc(rootNode.get(),getOuterScope()?getOuterScope():d,this);
2520-
}
2521-
if (detailsVisible)
2522-
{
2523-
//ol.endEmphasis();
2524-
ol.docify(" ");
2525-
ol.startTextLink(getOutputFileBase(),anchor());
2526-
ol.parseText(theTranslator->trMore());
2527-
ol.endTextLink();
2528-
//ol.startEmphasis();
2529-
}
2530-
if (!rootNode->isEmpty() || detailsVisible)
2531-
{
2532-
ol.endMemberDescription();
2533-
}
2534-
}
2535-
}
2536-
ol.popGeneratorState();
25372506

25382507
ol.endMemberDeclaration(anchor(),inheritId);
25392508

0 commit comments

Comments
 (0)