From f6484ad67d64513afde2cacd3d9b1320a3e422cc Mon Sep 17 00:00:00 2001 From: Renaud G Date: Fri, 6 May 2016 14:49:19 +0200 Subject: fix separator issue -remove dupplicates into resultat. --- diceparser.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/diceparser.cpp b/diceparser.cpp index 7e75db2..dfc4bc6 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -154,6 +154,7 @@ bool DiceParser::parseLine(QString str) delete m_start; m_start = NULL; } + m_currentTreeHasSeparator=false; m_start = new StartingNode(); ExecutionNode* newNode = NULL; m_current = m_start; @@ -429,7 +430,15 @@ QStringList DiceParser::getAllDiceResult(bool& hasAlias) DiceResult* stringResult = dynamic_cast(result); if(NULL!=stringResult) { - dieListResult << stringResult->getResultList(); + for(auto die : stringResult->getResultList()) + { + if(!dieListResult.contains(die)) + { + dieListResult.removeAll(die); + dieListResult << die; + } + } + //dieListResult << stringResult->getResultList(); hasAlias = true; } } @@ -437,9 +446,14 @@ QStringList DiceParser::getAllDiceResult(bool& hasAlias) } foreach(Die* die, dieListResult) { - foreach (qint64 value, die->getListValue()) + if(die->isHighlighted()) { - stringListResult << QString::number(value); + qDebug() << die->getValue() << die->hasBeenDisplayed() << die->isHighlighted() << die->isSelected() << die; + foreach (qint64 value, die->getListValue()) + { + + stringListResult << QString::number(value); + } } } -- cgit v1.2.3-70-g09d2