From 092118855ba47a0061e5b54198c49c3ad05b5aed Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 20 Apr 2012 14:59:30 +0200 Subject: 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 --- tests/auto/other/lancelot/paintcommands.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index 969db62acb..4e45c75e4d 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -694,7 +694,7 @@ void PaintCommands::runCommand(const QString &scriptLine) QString firstWord = scriptLine.section(QRegExp("\\s"), 0, 0); QList indices = s_commandHash.values(firstWord); foreach(int idx, indices) { - const PaintCommandInfos &command = s_commandInfoTable.at(idx); + PaintCommandInfos command = s_commandInfoTable.at(idx); if (command.regExp.indexIn(scriptLine) >= 0) { (this->*(command.paintMethod))(command.regExp); return; -- cgit v1.2.3