Editor: replace static functions with lambdas

Change-Id: I6e7c74b70e6752bbf8b030d6110a71bd5e3240c5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-02-05 13:25:46 +01:00
parent a1e408622a
commit ce40e13e3a

View File

@@ -160,16 +160,6 @@ enum { NExtraSelectionKinds = 12 };
using TransformationMethod = QString(const QString &);
using ListTransformationMethod = void(QStringList &);
static QString QString_toUpper(const QString &str)
{
return str.toUpper();
}
static QString QString_toLower(const QString &str)
{
return str.toLower();
}
class LineColumnLabel : public FixedSizeClickLabel
{
Q_OBJECT
@@ -1880,12 +1870,12 @@ void TextEditorWidget::moveLineDown()
void TextEditorWidget::uppercaseSelection()
{
d->transformSelection(&QString_toUpper);
d->transformSelection([](const QString &str) { return str.toUpper(); });
}
void TextEditorWidget::lowercaseSelection()
{
d->transformSelection(&QString_toLower);
d->transformSelection([](const QString &str) { return str.toLower(); });
}
void TextEditorWidget::sortSelectedLines()