Skip to content

Commit

Permalink
Fixup man only output to use generator state push pop
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-kink committed Sep 26, 2016
1 parent 98d3f8e commit 051fb8a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/classdef.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -954,9 +954,10 @@ void ClassDef::writeBriefDescription(OutputList &ol,bool exampleFlag)
if (hasBriefDescription()) if (hasBriefDescription())
{ {
ol.startParagraph(); ol.startParagraph();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" - "); ol.writeString(" - ");
ol.enableAll(); ol.popGeneratorState();
ol.generateDoc(briefFile(),briefLine(),this,0, ol.generateDoc(briefFile(),briefLine(),this,0,
briefDescription(),TRUE,FALSE,0,TRUE,FALSE); briefDescription(),TRUE,FALSE,0,TRUE,FALSE);
ol.pushGeneratorState(); ol.pushGeneratorState();
Expand Down
3 changes: 2 additions & 1 deletion src/dirdef.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ void DirDef::writeBriefDescription(OutputList &ol)
if (rootNode && !rootNode->isEmpty()) if (rootNode && !rootNode->isEmpty())
{ {
ol.startParagraph(); ol.startParagraph();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" - "); ol.writeString(" - ");
ol.enableAll(); ol.popGeneratorState();
ol.writeDoc(rootNode,this,0); ol.writeDoc(rootNode,this,0);
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::RTF);
Expand Down
3 changes: 2 additions & 1 deletion src/filedef.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -373,9 +373,10 @@ void FileDef::writeBriefDescription(OutputList &ol)
if (rootNode && !rootNode->isEmpty()) if (rootNode && !rootNode->isEmpty())
{ {
ol.startParagraph(); ol.startParagraph();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" - "); ol.writeString(" - ");
ol.enableAll(); ol.popGeneratorState();
ol.writeDoc(rootNode,this,0); ol.writeDoc(rootNode,this,0);
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::RTF);
Expand Down
9 changes: 6 additions & 3 deletions src/groupdef.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -712,10 +712,8 @@ void GroupDef::writeDetailedDescription(OutputList &ol,const QCString &title)
) )
{ {
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); // always print title for man page
if (pageDict->count()!=countMembers()) // not only pages -> classical layout if (pageDict->count()!=countMembers()) // not only pages -> classical layout
{ {
ol.enableAll();
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::Html); ol.disable(OutputGenerator::Html);
ol.writeRuler(); ol.writeRuler();
Expand All @@ -725,6 +723,10 @@ void GroupDef::writeDetailedDescription(OutputList &ol,const QCString &title)
ol.writeAnchor(0,"details"); ol.writeAnchor(0,"details");
ol.popGeneratorState(); ol.popGeneratorState();
} }
else
{
ol.disableAllBut(OutputGenerator::Man); // always print title for man page
}
ol.startGroupHeader(); ol.startGroupHeader();
ol.parseText(title); ol.parseText(title);
ol.endGroupHeader(); ol.endGroupHeader();
Expand Down Expand Up @@ -773,9 +775,10 @@ void GroupDef::writeBriefDescription(OutputList &ol)
if (rootNode && !rootNode->isEmpty()) if (rootNode && !rootNode->isEmpty())
{ {
ol.startParagraph(); ol.startParagraph();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" - "); ol.writeString(" - ");
ol.enableAll(); ol.popGeneratorState();
ol.writeDoc(rootNode,this,0); ol.writeDoc(rootNode,this,0);
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::RTF);
Expand Down
3 changes: 2 additions & 1 deletion src/namespacedef.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -408,9 +408,10 @@ void NamespaceDef::writeBriefDescription(OutputList &ol)
if (rootNode && !rootNode->isEmpty()) if (rootNode && !rootNode->isEmpty())
{ {
ol.startParagraph(); ol.startParagraph();
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" - "); ol.writeString(" - ");
ol.enableAll(); ol.popGeneratorState();
ol.writeDoc(rootNode,this,0); ol.writeDoc(rootNode,this,0);
ol.pushGeneratorState(); ol.pushGeneratorState();
ol.disable(OutputGenerator::RTF); ol.disable(OutputGenerator::RTF);
Expand Down
5 changes: 3 additions & 2 deletions src/pagedef.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -232,16 +232,17 @@ void PageDef::writePageDocumentation(OutputList &ol)
QCString docStr = documentation()+inbodyDocumentation(); QCString docStr = documentation()+inbodyDocumentation();
if (!docStr.isEmpty()) if (!docStr.isEmpty())
{ {
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Man); ol.disableAllBut(OutputGenerator::Man);
ol.writeString(" - "); ol.writeString(" - ");
ol.enableAll(); ol.popGeneratorState();
} }
ol.generateDoc( ol.generateDoc(
docFile(), // fileName docFile(), // fileName
docLine(), // startLine docLine(), // startLine
this, // context this, // context
0, // memberdef 0, // memberdef
docStr, // docStr docStr, // docStr
TRUE, // index words TRUE, // index words
FALSE // not an example FALSE // not an example
); );
Expand Down

0 comments on commit 051fb8a

Please sign in to comment.