diff options
| author | 2016-05-06 14:49:19 +0200 | |
|---|---|---|
| committer | 2016-05-06 14:49:19 +0200 | |
| commit | f6484ad67d64513afde2cacd3d9b1320a3e422cc (patch) | |
| tree | a93a855d10382bb59a082a900a6157b201b61b6d | |
| parent | 64c35992db5352833ccd6cb623dbb9e9362834dc (diff) | |
| download | OneRoll-f6484ad67d64513afde2cacd3d9b1320a3e422cc.tar.gz OneRoll-f6484ad67d64513afde2cacd3d9b1320a3e422cc.zip | |
fix separator issue
-remove dupplicates into resultat.
| -rw-r--r-- | diceparser.cpp | 20 |
1 files 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<DiceResult*>(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); + } } } |