aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2018-09-28 10:29:23 +0200
committerRenaud G <renaud@rolisteam.org>2018-09-28 10:29:23 +0200
commit048154df39a7fa4f276a19bc4ee2bb0ee53ab46b (patch)
tree5931de968e0e4ba5e299963d154f05def945390d
parent8bb4e7a3befc6ce549b631d8a83b9ba69ed73b7a (diff)
downloadOneRoll-048154df39a7fa4f276a19bc4ee2bb0ee53ab46b.tar.gz
OneRoll-048154df39a7fa4f276a19bc4ee2bb0ee53ab46b.zip
fix several replacement
-rw-r--r--cli/main.cpp8
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;