summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAnton Kudryavtsev <antkudr@mail.ru>2017-03-27 22:44:22 +0300
committerAnton Kudryavtsev <antkudr@mail.ru>2017-03-28 07:18:26 +0000
commit18d6c82299d51aacca55465dd1a2066a93440618 (patch)
tree073ddf23294be5f6d189cad61ea0451df5bc95d8 /src/gui
parente8cf0bf5f8fe0dd2b4bbfa0c85a32e7edb69e2f4 (diff)
Prefer rvalue versions of toLower() and toUpper()
... to re-use existing buffers. Change-Id: Ib2bc938f1cf0451c1dbc012b3db022b878e987cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/text/qcssparser.cpp4
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtexthtmlparser.cpp8
4 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index a6bc7d4d9c..20eac2ed15 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1183,7 +1183,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
QString keyName(tran == 0
? QCoreApplication::translate("QShortcut", keyname[i].name)
: QString::fromLatin1(keyname[i].name));
- if (accelRef == keyName.toLower()) {
+ if (accelRef == std::move(keyName).toLower()) {
ret |= keyname[i].key;
found = true;
break;
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index a0438bd458..9670f24b1e 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1822,7 +1822,7 @@ void StyleSheet::buildIndexes(Qt::CaseSensitivity nameCaseSensitivity)
nr.order = i;
QString name = sel.elementName;
if (nameCaseSensitivity == Qt::CaseInsensitive)
- name=name.toLower();
+ name = std::move(name).toLower();
nameIndex.insert(name, nr);
} else {
universalsSelectors += selector;
@@ -2027,7 +2027,7 @@ QVector<StyleRule> StyleSelector::styleRulesForNode(NodePtr node)
for (int i = 0; i < names.count(); i++) {
QString name = names.at(i);
if (nameCaseSensitivity == Qt::CaseInsensitive)
- name = name.toLower();
+ name = std::move(name).toLower();
QMultiHash<QString, StyleRule>::const_iterator it = styleSheet.nameIndex.constFind(name);
while (it != styleSheet.nameIndex.constEnd() && it.key() == name) {
matchRule(node, it.value(), styleSheet.origin, styleSheet.depth, &weightedRules);
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 6074917087..f8215f92e9 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -133,7 +133,7 @@ bool Qt::mightBeRichText(const QString& text)
return false; // that's not a tag
}
#ifndef QT_NO_TEXTHTMLPARSER
- return QTextHtmlParser::lookupElement(tag.toLower()) != -1;
+ return QTextHtmlParser::lookupElement(std::move(tag).toLower()) != -1;
#else
return false;
#endif // QT_NO_TEXTHTMLPARSER
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 269e505a56..8471c55e5f 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1525,7 +1525,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
} else if (value == QLatin1String("I")) {
node->listStyle = QTextListFormat::ListUpperRoman;
} else {
- value = value.toLower();
+ value = std::move(value).toLower();
if (value == QLatin1String("square"))
node->listStyle = QTextListFormat::ListSquare;
else if (value == QLatin1String("disc"))
@@ -1636,7 +1636,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
node->parseStyleAttribute(value, resourceProvider);
#endif
} else if (key == QLatin1String("align")) {
- value = value.toLower();
+ value = std::move(value).toLower();
bool alignmentSet = true;
if (value == QLatin1String("left"))
@@ -1664,7 +1664,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
}
}
} else if (key == QLatin1String("valign")) {
- value = value.toLower();
+ value = std::move(value).toLower();
if (value == QLatin1String("top"))
node->charFormat.setVerticalAlignment(QTextCharFormat::AlignTop);
else if (value == QLatin1String("middle"))
@@ -1672,7 +1672,7 @@ void QTextHtmlParser::applyAttributes(const QStringList &attributes)
else if (value == QLatin1String("bottom"))
node->charFormat.setVerticalAlignment(QTextCharFormat::AlignBottom);
} else if (key == QLatin1String("dir")) {
- value = value.toLower();
+ value = std::move(value).toLower();
if (value == QLatin1String("ltr"))
node->blockFormat.setLayoutDirection(Qt::LeftToRight);
else if (value == QLatin1String("rtl"))