summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-10-18 13:26:33 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-10-18 13:26:33 (GMT)
commitc004bfbfcdb5110ae1545e013ca555a9f4b75337 (patch)
tree12baef12f8595756b353a8c3fe4e9baea31ac17f /tools
parent8f3e9dc22c5d4d72984473139d2c9a382c79b963 (diff)
downloadQt-c004bfbfcdb5110ae1545e013ca555a9f4b75337.zip
Qt-c004bfbfcdb5110ae1545e013ca555a9f4b75337.tar.gz
Qt-c004bfbfcdb5110ae1545e013ca555a9f4b75337.tar.bz2
qdoc: Fixed <p> inside of <p> for legalese text.
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp22
-rw-r--r--tools/qdoc3/ditaxmlgenerator.h1
2 files changed, 17 insertions, 6 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index b69f511..27f36ff 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -64,6 +64,7 @@ int DitaXmlGenerator::id = 0;
bool DitaXmlGenerator::inApiDesc = false;
bool DitaXmlGenerator::inSection = false;
bool DitaXmlGenerator::inDetailedDescription = false;
+bool DitaXmlGenerator::inLegaleseText = false;
#define cxxapi_d_xref Doc::alias("cxxapi-d-xref")
#define cxxclass Doc::alias("cxxclass")
@@ -1122,11 +1123,10 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
// nothing
break;
case Atom::LegaleseLeft:
- xmlWriter().writeStartElement("p");
- xmlWriter().writeAttribute("outputclass","legalese");
+ inLegaleseText = true;
break;
case Atom::LegaleseRight:
- xmlWriter().writeEndElement(); // </p>
+ inLegaleseText = false;
break;
case Atom::LineBreak:
xmlWriter().writeEmptyElement("br");
@@ -1309,6 +1309,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
break;
case Atom::ParaLeft:
xmlWriter().writeStartElement("p");
+ if (inLegaleseText)
+ xmlWriter().writeAttribute("outputclass","legalese");
in_para = true;
break;
case Atom::ParaRight:
@@ -4547,9 +4549,17 @@ void DitaXmlGenerator::writeLocation(const Node* n)
s3 = CXXCLASSDECLARATIONFILELINE;
}
else if (n->type() == Node::Function) {
- s1 = CXXFUNCTIONAPIITEMLOCATION;
- s2 = CXXFUNCTIONDECLARATIONFILE;
- s3 = CXXFUNCTIONDECLARATIONFILELINE;
+ FunctionNode* fn = const_cast<FunctionNode*>(static_cast<const FunctionNode*>(n));
+ if (fn->isMacro()) {
+ s1 = CXXDEFINEAPIITEMLOCATION;
+ s2 = CXXDEFINEDECLARATIONFILE;
+ s3 = CXXDEFINEDECLARATIONFILELINE;
+ }
+ else {
+ s1 = CXXFUNCTIONAPIITEMLOCATION;
+ s2 = CXXFUNCTIONDECLARATIONFILE;
+ s3 = CXXFUNCTIONDECLARATIONFILELINE;
+ }
}
else if (n->type() == Node::Enum) {
s1 = CXXENUMERATIONAPIITEMLOCATION;
diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h
index 30c398b..0a9fc4a 100644
--- a/tools/qdoc3/ditaxmlgenerator.h
+++ b/tools/qdoc3/ditaxmlgenerator.h
@@ -308,6 +308,7 @@ class DitaXmlGenerator : public PageGenerator
static bool inApiDesc;
static bool inSection;
static bool inDetailedDescription;
+ static bool inLegaleseText;
QStack<QXmlStreamWriter*> xmlWriterStack;
};