summaryrefslogtreecommitdiff
path: root/src/qdoc/doc.cpp
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2019-08-07 20:37:57 +0200
committerPaul Wicking <paul.wicking@qt.io>2019-08-08 07:23:16 +0200
commit455bda44cb83b622fddd5954bf27c61a99bf2eba (patch)
tree6df4dd58025ba85e6baa39fa3bb819dba3aa1eca /src/qdoc/doc.cpp
parent000f678697fcc8c5512f4ae96c2a49eea9ba8066 (diff)
downloadqttools-455bda44cb83b622fddd5954bf27c61a99bf2eba.tar.gz
QDoc: Clean up whitespace
Ensure that QDoc conforms to Qt style, whitespace edition. For the most part, the change involves moving the pointer operators. Also remove whitespace following an opening parenthesis, or immediately preceding a closing one. In some cases, adjust the following line accordingly in methods that span multiple lines. Change-Id: I56ae125a2acf09c669c0a73dc814d05f13575f39 Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc/doc.cpp')
-rw-r--r--src/qdoc/doc.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp
index c149f366d..0e23f60a7 100644
--- a/src/qdoc/doc.cpp
+++ b/src/qdoc/doc.cpp
@@ -298,10 +298,10 @@ class DocPrivateExtra
public:
Doc::Sections granularity_;
Doc::Sections section_; // ###
- QList<Atom*> tableOfContents_;
+ QList<Atom *> tableOfContents_;
QVector<int> tableOfContentsLevels_;
- QList<Atom*> keywords_;
- QList<Atom*> targets_;
+ QList<Atom *> keywords_;
+ QList<Atom *> targets_;
QStringMultiMap metaMap_;
DocPrivateExtra()
@@ -334,12 +334,12 @@ typedef QMap<QString, ArgList> CommandMap;
class DocPrivate : public Shared
{
public:
- DocPrivate(const Location& start = Location::null,
- const Location& end = Location::null,
- const QString& source = QString());
+ DocPrivate(const Location &start = Location::null,
+ const Location &end = Location::null,
+ const QString &source = QString());
~DocPrivate();
- void addAlso(const Text& also);
+ void addAlso(const Text &also);
void constructExtra();
bool isEnumDocSimplifiable() const;
@@ -361,9 +361,9 @@ public:
DitaRefList ditamap_;
};
-DocPrivate::DocPrivate(const Location& start,
- const Location& end,
- const QString& source)
+DocPrivate::DocPrivate(const Location &start,
+ const Location &end,
+ const QString &source)
: start_loc(start),
end_loc(end),
src(source),
@@ -381,12 +381,12 @@ DocPrivate::DocPrivate(const Location& start,
DocPrivate::~DocPrivate()
{
delete extra;
- foreach (DitaRef* t, ditamap_) {
+ foreach (DitaRef *t, ditamap_) {
delete t;
}
}
-void DocPrivate::addAlso(const Text& also)
+void DocPrivate::addAlso(const Text &also)
{
alsoList.append(also);
}
@@ -426,15 +426,15 @@ public:
void parse(const QString &source,
DocPrivate *docPrivate,
const QSet<QString> &metaCommandSet,
- const QSet<QString>& possibleTopics);
+ const QSet<QString> &possibleTopics);
static int endCmdFor(int cmd);
static QString cmdName(int cmd);
static QString endCmdName(int cmd);
- static QString untabifyEtc(const QString& str);
- static int indentLevel(const QString& str);
- static QString unindent(int level, const QString& str);
- static QString slashed(const QString& str);
+ static QString untabifyEtc(const QString &str);
+ static int indentLevel(const QString &str);
+ static QString unindent(int level, const QString &str);
+ static QString slashed(const QString &str);
static int tabSize;
static QStringList exampleFiles;
@@ -444,21 +444,21 @@ public:
static bool quoting;
private:
- Location& location();
- QString detailsUnknownCommand(const QSet<QString>& metaCommandSet,
- const QString& str);
- void insertTarget(const QString& target, bool keyword);
- void include(const QString& fileName, const QString& identifier);
- void startFormat(const QString& format, int cmd);
+ Location &location();
+ QString detailsUnknownCommand(const QSet<QString> &metaCommandSet,
+ const QString &str);
+ void insertTarget(const QString &target, bool keyword);
+ void include(const QString &fileName, const QString &identifier);
+ void startFormat(const QString &format, int cmd);
bool openCommand(int cmd);
bool closeCommand(int endCmd);
void startSection(Doc::Sections unit, int cmd);
void endSection(int unit, int endCmd);
void parseAlso();
void append(const QString &string);
- void append(Atom::AtomType type, const QString& string = QString());
- void append(Atom::AtomType type, const QString& p1, const QString& p2);
- void append(const QString& p1, const QString& p2);
+ void append(Atom::AtomType type, const QString &string = QString());
+ void append(Atom::AtomType type, const QString &p1, const QString &p2);
+ void append(const QString &p1, const QString &p2);
void appendChar(QChar ch);
void appendWord(const QString &word);
void appendToCode(const QString &code);
@@ -466,14 +466,14 @@ private:
void startNewPara();
void enterPara(Atom::AtomType leftType = Atom::ParaLeft,
Atom::AtomType rightType = Atom::ParaRight,
- const QString& string = QString());
+ const QString &string = QString());
void leavePara();
void leaveValue();
void leaveValueList();
void leaveTableRow();
CodeMarker *quoteFromFile();
bool expandMacro();
- void expandMacro(const QString& name, const QString& def, int numParams);
+ void expandMacro(const QString &name, const QString &def, int numParams);
QString expandMacroToString(const QString &name, const QString &def, int numParams, const QString &matchExpr);
Doc::Sections getSectioningUnit();
QString getArgument(bool verbatim = false);
@@ -528,7 +528,7 @@ private:
QStack<int> openedCommands;
QStack<OpenedList> openedLists;
Quoter quoter;
- QStack<DitaRef*> ditarefs_;
+ QStack<DitaRef *> ditarefs_;
Atom *lastAtom;
};
@@ -548,10 +548,10 @@ bool DocParser::quoting = false;
found in \a source. These metacommands are not markup text
commands. They are topic commands and related metacommands.
*/
-void DocParser::parse(const QString& source,
+void DocParser::parse(const QString &source,
DocPrivate *docPrivate,
- const QSet<QString>& metaCommandSet,
- const QSet<QString>& possibleTopics)
+ const QSet<QString> &metaCommandSet,
+ const QSet<QString> &possibleTopics)
{
input_ = source;
pos = 0;
@@ -978,7 +978,7 @@ void DocParser::parse(const QString& source,
case CMD_TOPICREF:
case CMD_MAPREF:
if (openCommand(cmd)) {
- DitaRef* t = nullptr;
+ DitaRef *t = nullptr;
if (cmd == CMD_MAPREF)
t = new MapRef();
else
@@ -1682,7 +1682,7 @@ void DocParser::insertTarget(const QString &target, bool keyword)
}
}
-void DocParser::include(const QString& fileName, const QString& identifier)
+void DocParser::include(const QString &fileName, const QString &identifier)
{
if (location().depth() > 16)
location().fatal(tr("Too many nested '\\%1's").arg(cmdName(CMD_INCLUDE)));
@@ -1766,7 +1766,7 @@ void DocParser::include(const QString& fileName, const QString& identifier)
}
}
-void DocParser::startFormat(const QString& format, int cmd)
+void DocParser::startFormat(const QString &format, int cmd)
{
enterPara();
@@ -1966,7 +1966,7 @@ void DocParser::append(const QString &string)
priv->text << Atom(string); // The Atom type is Link.
}
-void DocParser::append(Atom::AtomType type, const QString& p1, const QString& p2)
+void DocParser::append(Atom::AtomType type, const QString &p1, const QString &p2)
{
Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
@@ -1974,7 +1974,7 @@ void DocParser::append(Atom::AtomType type, const QString& p1, const QString& p2
priv->text << Atom(type, p1, p2);
}
-void DocParser::append(const QString& p1, const QString& p2)
+void DocParser::append(const QString &p1, const QString &p2)
{
Atom::AtomType lastType = priv->text.lastAtom()->type();
if ((lastType == Atom::Code) && priv->text.lastAtom()->string().endsWith(QLatin1String("\n\n")))
@@ -2007,7 +2007,7 @@ void DocParser::appendWord(const QString &word)
priv->text.lastAtom()->appendString(word);
}
-void DocParser::appendToCode(const QString& markedCode)
+void DocParser::appendToCode(const QString &markedCode)
{
if (!isCode(lastAtom)) {
append(Atom::Code);
@@ -2034,7 +2034,7 @@ void DocParser::startNewPara()
void DocParser::enterPara(Atom::AtomType leftType,
Atom::AtomType rightType,
- const QString& string)
+ const QString &string)
{
if (paraState == OutsideParagraph) {
@@ -2749,7 +2749,7 @@ QString DocParser::endCmdName(int cmd)
return cmdName(endCmdFor(cmd));
}
-QString DocParser::untabifyEtc(const QString& str)
+QString DocParser::untabifyEtc(const QString &str)
{
QString result;
result.reserve(str.length());
@@ -2783,7 +2783,7 @@ QString DocParser::untabifyEtc(const QString& str)
return result;
}
-int DocParser::indentLevel(const QString& str)
+int DocParser::indentLevel(const QString &str)
{
int minIndent = INT_MAX;
int column = 0;
@@ -2801,7 +2801,7 @@ int DocParser::indentLevel(const QString& str)
return minIndent;
}
-QString DocParser::unindent(int level, const QString& str)
+QString DocParser::unindent(int level, const QString &str)
{
if (level == 0)
return str;
@@ -2823,7 +2823,7 @@ QString DocParser::unindent(int level, const QString& str)
return t;
}
-QString DocParser::slashed(const QString& str)
+QString DocParser::slashed(const QString &str)
{
QString result = str;
result.replace(QLatin1Char('/'), "\\/");
@@ -2862,18 +2862,18 @@ bool DocParser::isQuote(const Atom *atom)
QML documentation, there is the case where the qdoc \e{qmlproperty}
command can appear multiple times in a qdoc comment.
*/
-Doc::Doc(const Location& start_loc,
- const Location& end_loc,
- const QString& source,
- const QSet<QString>& metaCommandSet,
- const QSet<QString>& topics)
+Doc::Doc(const Location &start_loc,
+ const Location &end_loc,
+ const QString &source,
+ const QSet<QString> &metaCommandSet,
+ const QSet<QString> &topics)
{
priv = new DocPrivate(start_loc,end_loc,source);
DocParser parser;
parser.parse(source,priv,metaCommandSet,topics);
}
-Doc::Doc(const Doc& doc)
+Doc::Doc(const Doc &doc)
: priv(nullptr)
{
operator=(doc);
@@ -2885,7 +2885,7 @@ Doc::~Doc()
delete priv;
}
-Doc &Doc::operator=(const Doc& doc)
+Doc &Doc::operator=(const Doc &doc)
{
if (doc.priv)
doc.priv->ref();
@@ -2941,7 +2941,7 @@ const Location &Doc::location() const
/*!
Returns the starting location of a qdoc comment.
*/
-const Location& Doc::startLocation() const
+const Location &Doc::startLocation() const
{
return location();
}
@@ -2949,7 +2949,7 @@ const Location& Doc::startLocation() const
/*!
Returns the ending location of a qdoc comment.
*/
-const Location& Doc::endLocation() const
+const Location &Doc::endLocation() const
{
static const Location dummy;
return priv == nullptr ? dummy : priv->end_loc;
@@ -2966,7 +2966,7 @@ bool Doc::isEmpty() const
return priv == nullptr || priv->src.isEmpty();
}
-const Text& Doc::body() const
+const Text &Doc::body() const
{
static const Text dummy;
return priv == nullptr ? dummy : priv->text;
@@ -3103,12 +3103,12 @@ bool Doc::isMarkedReimp() const
current qdoc comment. Normally there is only one, but there
can be multiple \e{qmlproperty} commands, for example.
*/
-const TopicList& Doc::topicsUsed() const
+const TopicList &Doc::topicsUsed() const
{
return priv == nullptr ? *nullTopicList() : priv->topics_;
}
-ArgList Doc::metaCommandArgs(const QString& metacommand) const
+ArgList Doc::metaCommandArgs(const QString &metacommand) const
{
return priv == nullptr ? ArgList() : priv->metaCommandMap.value(metacommand);
}
@@ -3162,9 +3162,9 @@ const QStringMultiMap &Doc::metaTagMap() const
return priv && priv->extra ? priv->extra->metaMap_ : *null_QStringMultiMap();
}
-const Config* Doc::config_ = nullptr;
+const Config *Doc::config_ = nullptr;
-void Doc::initialize(const Config& config)
+void Doc::initialize(const Config &config)
{
DocParser::tabSize = config.getInt(CONFIG_TABSIZE);
DocParser::exampleFiles = config.getCanonicalPathList(CONFIG_EXAMPLES);
@@ -3280,7 +3280,7 @@ QString Doc::alias(const QString &english)
Trims the deadwood out of \a str. i.e., this function
cleans up \a str.
*/
-void Doc::trimCStyleComment(Location& location, QString& str)
+void Doc::trimCStyleComment(Location &location, QString &str)
{
QString cleaned;
Location m = location;
@@ -3423,7 +3423,7 @@ void Doc::detach()
*/
TopicRef::~TopicRef()
{
- foreach (DitaRef* t, subrefs_) {
+ foreach (DitaRef *t, subrefs_) {
delete t;
}
}