From 048154df39a7fa4f276a19bc4ee2bb0ee53ab46b Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 28 Sep 2018 10:29:23 +0200 Subject: fix several replacement --- cli/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/main.cpp') 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; -- cgit v1.2.3-70-g09d2