diff options
| author | 2019-07-29 20:35:52 +0000 | |
|---|---|---|
| committer | 2019-07-29 20:35:52 +0000 | |
| commit | 1a902d383eef1e042d4462cd07b9384fcdf4d118 (patch) | |
| tree | 766b8ab720fa5da11730d2fc2388f51b9d14de49 /result/stringresult.cpp | |
| parent | f5906125576a8323a731c9456ce3dfc53b67ef59 (diff) | |
| parent | 0d4b68221bda594cc695d216dfa21306ddb69c85 (diff) | |
| download | OneRoll-1a902d383eef1e042d4462cd07b9384fcdf4d118.tar.gz OneRoll-1a902d383eef1e042d4462cd07b9384fcdf4d118.zip | |
Merge branch 'liberation' into 'master'
Add fuzzer on the DiceParser
See merge request kde/rolisteam-diceparser!2
Diffstat (limited to 'result/stringresult.cpp')
| -rw-r--r-- | result/stringresult.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/result/stringresult.cpp b/result/stringresult.cpp index a44e24e..d5a7880 100644 --- a/result/stringresult.cpp +++ b/result/stringresult.cpp @@ -3,20 +3,21 @@ StringResult::StringResult() { m_highlight= true; - m_resultTypes= Result::STRING; + m_resultTypes= static_cast<int>(Dice::RESULT_TYPE::STRING); } void StringResult::setText(QString text) { m_value= text; } StringResult::~StringResult() {} -bool StringResult::hasResultOfType(RESULT_TYPE resultType) const +bool StringResult::hasResultOfType(Dice::RESULT_TYPE resultType) const { - if(resultType & Result::STRING) + + if(resultType == Dice::RESULT_TYPE::STRING) { return true; } - else if(resultType & Result::SCALAR) + else if(resultType == Dice::RESULT_TYPE::SCALAR) { bool ok= false; getText().toInt(&ok); @@ -28,13 +29,13 @@ QString StringResult::getText() const { return m_value; } -QVariant StringResult::getResult(RESULT_TYPE type) +QVariant StringResult::getResult(Dice::RESULT_TYPE type) { switch(type) { - case STRING: + case Dice::RESULT_TYPE::STRING: return getText(); - case SCALAR: + case Dice::RESULT_TYPE::SCALAR: return getText().toInt(); default: return QVariant(); |