aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dicealias.cpp
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-08-22 02:07:30 +0200
committerRenaud G <renaud@rolisteam.org>2018-08-22 02:07:30 +0200
commit52343ff414f7b41e8f38e28bec3de39500b5fed2 (patch)
treeda96c1d107654c888f75a782bd780bbd66617ad5 /dicealias.cpp
parent16fbd4299406d069a142871a444c462f9a7fd57e (diff)
downloadOneRoll-52343ff414f7b41e8f38e28bec3de39500b5fed2.tar.gz
OneRoll-52343ff414f7b41e8f38e28bec3de39500b5fed2.zip
Fix bug on dicealias replacement (when several replacement must be done
on the same command).
Diffstat (limited to 'dicealias.cpp')
-rw-r--r--dicealias.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/dicealias.cpp b/dicealias.cpp
index a27919d..f514e9e 100644
--- a/dicealias.cpp
+++ b/dicealias.cpp
@@ -89,9 +89,11 @@ QString makeReplament(const QString& pattern, const QString& replacement, QStrin
patternPosList.push_back(pos);
pos+=1;
}
- for(auto pos : patternPosList)
+
+ // TODO to be replace by C++14 when it is ready
+ for (auto i = patternPosList.rbegin(); i != patternPosList.rend(); ++i)
{
- cmd.replace(pos,1,replacement);
+ cmd.replace(*i,1,replacement);
}
}
}