(relative);
if (dn && !dn->members().isEmpty()) {
// Reverse the list into the original scan order.
@@ -1210,13 +1211,13 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
p2 = atom->string(1);
}
if (!p1.isEmpty()) {
- if (p1 == "borderless")
+ if (p1 == QLatin1String("borderless"))
attr = p1;
else if (p1.contains("%"))
width = p1;
}
if (!p2.isEmpty()) {
- if (p2 == "borderless")
+ if (p2 == QLatin1String("borderless"))
attr = p2;
else if (p2.contains("%"))
width = p2;
@@ -3158,13 +3159,13 @@ void HtmlGenerator::generateList(const Node* relative, CodeMarker* marker, const
{
CNMap cnm;
Node::Genus genus = Node::DontCare;
- if (selector == "overviews")
+ if (selector == QLatin1String("overviews"))
genus = Node::DOC;
- else if (selector == "cpp-modules")
+ else if (selector == QLatin1String("cpp-modules"))
genus = Node::CPP;
- else if (selector == "qml-modules")
+ else if (selector == QLatin1String("qml-modules"))
genus = Node::QML;
- else if (selector == "js-modules")
+ else if (selector == QLatin1String("js-modules"))
genus = Node::JS;
if (genus != Node::DontCare) {
NodeList nl;
@@ -3409,6 +3410,7 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
{
QString src = markedCode;
QString html;
+ html.reserve(src.size());
QStringRef arg;
QStringRef par1;
@@ -3421,62 +3423,30 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
static const QString linkTag("link");
// replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(@link>)"
+ // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)(@func>)"
+ // replace all "(<@(type|headerfile)(?: +[^>]*)?>)(.*)(@\\2>)" tags
bool done = false;
for (int i = 0, srcSize = src.size(); i < srcSize;) {
if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
if (alignNames && !done) {
- html += "";
+ html += QLatin1String(" | ");
done = true;
}
i += 2;
if (parseArg(src, linkTag, &i, srcSize, &arg, &par1)) {
- html += "";
+ html += QLatin1String("");
const Node* n = CodeMarker::nodeForString(par1.toString());
QString link = linkForNode(n, relative);
addLink(link, arg, &html);
- html += "";
+ html += QLatin1String("");
}
- else {
- html += charLangle;
- html += charAt;
- }
- }
- else {
- html += src.at(i++);
- }
- }
-
- // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)(@func>)"
- src = html;
- html = QString();
- for (int i = 0, srcSize = src.size(); i < srcSize;) {
- if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
- i += 2;
- if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
+ else if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
const Node* n = qdb_->findFunctionNode(par1.toString(), relative, Node::DontCare);
QString link = linkForNode(n, relative);
addLink(link, arg, &html);
par1 = QStringRef();
}
- else {
- html += charLangle;
- html += charAt;
- }
- }
- else {
- html += src.at(i++);
- }
- }
-
- // replace all "(<@(type|headerfile)(?: +[^>]*)?>)(.*)(@\\2>)" tags
- src = html;
- html = QString();
-
- for (int i=0, srcSize=src.size(); ifindTypeNode(arg.toString(), relative);
html += QLatin1String("");
@@ -3489,7 +3459,6 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
else
addLink(linkForNode(n,relative), arg, &html);
html += QLatin1String("");
- handled = true;
}
else if (parseArg(src, headerTag, &i, srcSize, &arg, &par1)) {
par1 = QStringRef();
@@ -3502,9 +3471,8 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
else
html += arg;
}
- handled = true;
}
- if (!handled) {
+ else {
html += charLangle;
html += charAt;
}
@@ -3527,60 +3495,68 @@ QString HtmlGenerator::highlightedCode(const QString& markedCode,
// "@(?:comment|preprocessor|string|char|number|op|type|name|keyword)>" -> ""
src = html;
html = QString();
- static const QString spanTags[] = {
- "<@comment>", "",
+ html.reserve(src.size());
+ static const QLatin1String spanTags[] = {
+ QLatin1String("comment>"), QLatin1String(" |