diff options
| author | 2018-09-28 10:29:23 +0200 | |
|---|---|---|
| committer | 2018-09-28 10:29:23 +0200 | |
| commit | 048154df39a7fa4f276a19bc4ee2bb0ee53ab46b (patch) | |
| tree | 5931de968e0e4ba5e299963d154f05def945390d /cli/main.cpp | |
| parent | 8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a (diff) | |
| download | OneRoll-048154df39a7fa4f276a19bc4ee2bb0ee53ab46b.tar.gz OneRoll-048154df39a7fa4f276a19bc4ee2bb0ee53ab46b.zip | |
fix several replacement
Diffstat (limited to 'cli/main.cpp')
| -rw-r--r-- | cli/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/main.cpp b/cli/main.cpp index 198c85c..a165451 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -261,11 +261,11 @@ int startDiceParsing(QStringList& cmds,QString& treeFile,bool withColor, EXPORTF stringResult.replace("%1",scalarText); stringResult.replace("%3",lastScalarText); - int i = 1; - for(auto value : strLst) + int i = strLst.size(); + for(auto it = strLst.rbegin(); it != strLst.rend() ; ++it) { - stringResult.replace(QStringLiteral("$%1").arg(i),value); - ++i; + stringResult.replace(QStringLiteral("$%1").arg(i),(*it)); + --i; } resultStr = stringResult; |