summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-04-20 14:59:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-24 19:36:55 +0200
commit092118855ba47a0061e5b54198c49c3ad05b5aed (patch)
tree0c8279ca66b389979b02d37620a4866f21daf7da /src/gui/text/qtextdocument.cpp
parentfd7e1cef9cc06a2e36d98942c6e929ee5589952e (diff)
Don't use the QRegExp methods that modify the object [QtGui]
QRegExp matching methods modify the object, which we don't want to. In particular, when we receive a QRegExp from the user or we store in a context that might require thread-safety, make sure we make a copy before using it. QRegularExpression has no such shortcoming. Task-number: QTBUG-25064 Change-Id: If119e06221ca99e57c5ad1a1d4cc6468e9f68c7b Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index a8991d5428..f9fe166c29 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1281,7 +1281,7 @@ QTextCursor QTextDocument::find(const QString &subString, const QTextCursor &fro
static bool findInBlock(const QTextBlock &block, const QRegExp &expression, int offset,
QTextDocument::FindFlags options, QTextCursor &cursor)
{
- const QRegExp expr(expression);
+ QRegExp expr(expression);
QString text = block.text();
text.replace(QChar::Nbsp, QLatin1Char(' '));