diff options
Diffstat (limited to 'src/qdoc/htmlgenerator.cpp')
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index b95ef2932..f0f9f51cd 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -403,7 +403,7 @@ qsizetype HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, Co out() << formattingLeftMap()[atom->string()]; if (atom->string() == ATOM_FORMATTING_PARAMETER) { if (atom->next() != nullptr && atom->next()->type() == Atom::String) { - QRegularExpression subscriptRegExp("^([a-z]+)_([0-9n])$"); + static const QRegularExpression subscriptRegExp("^([a-z]+)_([0-9n])$"); auto match = subscriptRegExp.match(atom->next()->string()); if (match.hasMatch()) { out() << match.captured(1) << "<sub>" << match.captured(2) @@ -1807,7 +1807,7 @@ void HtmlGenerator::generateHeader(const QString &title, const Node *node, CodeM QVersionNumber projectVersion = QVersionNumber::fromString(m_qdb->version()); if (!projectVersion.isNull()) { QVersionNumber titleVersion; - QRegularExpression re(QLatin1String(R"(\d+\.\d+)")); + static const QRegularExpression re(QLatin1String(R"(\d+\.\d+)")); const QString &versionedTitle = titleSuffix.isEmpty() ? title : titleSuffix; auto match = re.match(versionedTitle); if (match.hasMatch()) @@ -2938,7 +2938,7 @@ void HtmlGenerator::generateQmlItem(const Node *node, const Node *relative, Code bool summary) { QString marked = marker->markedUpQmlItem(node, summary); - QRegularExpression templateTag("(<[^@>]*>)"); + static const QRegularExpression templateTag("(<[^@>]*>)"); auto match = templateTag.match(marked); if (match.hasMatch()) { QString contents = protectEnc(match.captured(1)); @@ -2947,7 +2947,8 @@ void HtmlGenerator::generateQmlItem(const Node *node, const Node *relative, Code // Look for the _ character in the member name followed by a number (or n): // this is intended to be rendered as a subscript. - marked.replace(QRegularExpression("<@param>([a-z]+)_([0-9]+|n)</@param>"), "<i>\\1<sub>\\2</sub></i>"); + static const QRegularExpression re("<@param>([a-z]+)_([0-9]+|n)</@param>"); + marked.replace(re, "<i>\\1<sub>\\2</sub></i>"); // Replace some markup by HTML tags. Do both the opening and the closing tag // in one go (instead of <@param> and </@param> separately, for instance). marked.replace("@param>", "i>"); @@ -3174,14 +3175,15 @@ void HtmlGenerator::generateSynopsis(const Node *node, const Node *relative, Cod { QString marked = marker->markedUpSynopsis(node, relative, style); - QRegularExpression templateTag("(<[^@>]*>)"); + static const QRegularExpression templateTag("(<[^@>]*>)"); auto match = templateTag.match(marked); if (match.hasMatch()) { QString contents = protectEnc(match.captured(1)); marked.replace(match.capturedStart(1), match.capturedLength(1), contents); } - marked.replace(QRegularExpression("<@param>([a-z]+)_([1-9n])</@param>"), "<i>\\1<sub>\\2</sub></i>"); + static const QRegularExpression re("<@param>([a-z]+)_([1-9n])</@param>"); + marked.replace(re, "<i>\\1<sub>\\2</sub></i>"); marked.replace("<@param>", "<i>"); marked.replace("</@param>", "</i>"); @@ -3191,7 +3193,8 @@ void HtmlGenerator::generateSynopsis(const Node *node, const Node *relative, Cod } if (style == Section::AllMembers) { - QRegularExpression extraRegExp("<@extra>.*</@extra>", QRegularExpression::InvertedGreedinessOption); + static const QRegularExpression extraRegExp("<@extra>.*</@extra>", + QRegularExpression::InvertedGreedinessOption); marked.remove(extraRegExp); } else { marked.replace("<@extra>", "<code translate=\"no\">"); |