diff options
| author | 2018-08-22 02:07:30 +0200 | |
|---|---|---|
| committer | 2018-08-22 02:07:30 +0200 | |
| commit | 52343ff414f7b41e8f38e28bec3de39500b5fed2 (patch) | |
| tree | da96c1d107654c888f75a782bd780bbd66617ad5 /dicealias.cpp | |
| parent | 16fbd4299406d069a142871a444c462f9a7fd57e (diff) | |
| download | OneRoll-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.cpp | 6 |
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); } } } |