summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2014-09-22 14:02:25 +0200
committerhjk <hjk121@nokiamail.com>2014-09-22 19:17:54 +0200
commitfaeac783f0f8de72771e8ff8d6bb7b908a00c277 (patch)
tree5b2fd5a30708717b75a40b549ef18da166d27b05
parent10cb7abe1762188c901685264b60515c3b15023b (diff)
downloadqt-creator-faeac783f0f8de72771e8ff8d6bb7b908a00c277.tar.gz
Make compile with Qt 5.4
Partial backport of 5da75dba065df3a16d2c58fcd89027750b34f12f Change-Id: I5d0964818934a2a0fc57c97b229469fd5a6c8131 Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
-rw-r--r--src/plugins/texteditor/basetexteditor.cpp18
-rw-r--r--src/plugins/texteditor/basetexteditor.h2
2 files changed, 15 insertions, 5 deletions
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 4f18085d29..c32bcc9105 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -116,6 +116,16 @@
using namespace Core;
using namespace Utils;
+static QString QString_toUpper(const QString &str)
+{
+ return str.toUpper();
+}
+
+static QString QString_toLower(const QString &str)
+{
+ return str.toLower();
+}
+
namespace TextEditor {
namespace Internal {
@@ -1008,12 +1018,12 @@ void BaseTextEditorWidget::moveLineDown()
void BaseTextEditorWidget::uppercaseSelection()
{
- transformSelection(&QString::toUpper);
+ transformSelection(&QString_toUpper);
}
void BaseTextEditorWidget::lowercaseSelection()
{
- transformSelection(&QString::toLower);
+ transformSelection(&QString_toLower);
}
void BaseTextEditorWidget::indent()
@@ -6555,7 +6565,7 @@ void BaseTextEditorWidget::transformSelection(TransformationMethod method)
}
QString text = cursor.selectedText();
- QString transformedText = (text.*method)();
+ QString transformedText = method(text);
if (transformedText == text) {
// if the transformation does not do anything to the selection, do no create an undo step
@@ -6600,7 +6610,7 @@ void BaseTextEditorWidget::transformBlockSelection(TransformationMethod method)
if (startPos < endPos) {
cursor.setPosition(startPos);
cursor.setPosition(endPos, QTextCursor::KeepAnchor);
- const QString &transformedText = (d->m_document->textAt(startPos, endPos - startPos).*method)();
+ const QString &transformedText = method(d->m_document->textAt(startPos, endPos - startPos));
if (transformedText != cursor.selectedText())
cursor.insertText(transformedText);
}
diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h
index 0fe282b03b..877f4cbdcb 100644
--- a/src/plugins/texteditor/basetexteditor.h
+++ b/src/plugins/texteditor/basetexteditor.h
@@ -64,7 +64,7 @@ typedef QList<RefactorMarker> RefactorMarkers;
namespace Internal {
class BaseTextEditorWidgetPrivate;
class TextEditorOverlay;
- typedef QString (QString::*TransformationMethod)() const;
+ typedef QString (TransformationMethod)(const QString &);
}
class ITextMarkable;