summaryrefslogtreecommitdiffstats
path: root/src/qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/qdoc')
-rw-r--r--src/qdoc/atom.cpp2
-rw-r--r--src/qdoc/atom.h22
-rw-r--r--src/qdoc/doc.cpp4
3 files changed, 10 insertions, 18 deletions
diff --git a/src/qdoc/atom.cpp b/src/qdoc/atom.cpp
index 298d2bbd4..f4920f43e 100644
--- a/src/qdoc/atom.cpp
+++ b/src/qdoc/atom.cpp
@@ -377,7 +377,7 @@ void Atom::dump() const
the space character.
*/
LinkAtom::LinkAtom(const QString &p1, const QString &p2)
- : Atom(p1),
+ : Atom(Atom::Link, p1),
resolved_(false),
genus_(Node::DontCare),
goal_(Node::NoType),
diff --git a/src/qdoc/atom.h b/src/qdoc/atom.h
index f7cb0b654..6b37618e8 100644
--- a/src/qdoc/atom.h
+++ b/src/qdoc/atom.h
@@ -134,37 +134,29 @@ public:
friend class LinkAtom;
- Atom(const QString &string) : next_(nullptr), type_(Link) { strs << string; }
+ Atom(AtomType type, const QString &string = "") : type_(type), strs(string) {}
- Atom(AtomType type, const QString &string = "") : next_(nullptr), type_(type)
+ Atom(AtomType type, const QString &p1, const QString &p2) : type_(type), strs(p1)
{
- strs << string;
- }
-
- Atom(AtomType type, const QString &p1, const QString &p2) : next_(nullptr), type_(type)
- {
- strs << p1;
if (!p2.isEmpty())
strs << p2;
}
- Atom(Atom *previous, AtomType type, const QString &string = "")
- : next_(previous->next_), type_(type)
+ Atom(Atom *previous, AtomType type, const QString &string)
+ : next_(previous->next_), type_(type), strs(string)
{
- strs << string;
previous->next_ = this;
}
Atom(Atom *previous, AtomType type, const QString &p1, const QString &p2)
- : next_(previous->next_), type_(type)
+ : next_(previous->next_), type_(type), strs(p1)
{
- strs << p1;
if (!p2.isEmpty())
strs << p2;
previous->next_ = this;
}
- virtual ~Atom() {}
+ virtual ~Atom() = default;
void appendChar(QChar ch) { strs[0] += ch; }
void appendString(const QString &string) { strs[0] += string; }
@@ -194,7 +186,7 @@ public:
protected:
static QString noError_;
- Atom *next_;
+ Atom *next_ = nullptr;
AtomType type_;
QStringList strs;
};
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index 0d5d059d6..89748b0ad 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -1860,7 +1860,7 @@ void DocParser::append(const QString &string)
Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
- priv->text << Atom(string); // The Atom type is Link.
+ priv->text << Atom(Atom::Link, string);
}
void DocParser::append(Atom::AtomType type, const QString &p1, const QString &p2)
@@ -1877,7 +1877,7 @@ void DocParser::append(const QString &p1, const QString &p2)
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
priv->text.lastAtom()->chopString();
if (p2.isEmpty())
- priv->text << Atom(p1); // The Atom type is Link.
+ priv->text << Atom(Atom::Link, p1);
else
priv->text << LinkAtom(p1, p2);
}