diff options
author | albert-github <albert.tests@gmail.com> | 2020-12-29 10:00:03 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-12-29 10:00:03 (GMT) |
commit | c03dd8a0105a6d020983981d17b1429dd4835103 (patch) | |
tree | 794896021236d408b433dd0e59a1793619f8df4d /addon/doxywizard/inputstrlist.cpp | |
parent | af6bf4883affe57d3be48e4b4538eb3c47decfad (diff) | |
download | Doxygen-c03dd8a0105a6d020983981d17b1429dd4835103.zip Doxygen-c03dd8a0105a6d020983981d17b1429dd4835103.tar.gz Doxygen-c03dd8a0105a6d020983981d17b1429dd4835103.tar.bz2 |
issue #8282 Error on ALIAS declaration without quotes
- also escape a "," (comma) when writing out string values (doxygen and doxywizard)
- check on empty lists in stringlist for the wizard
Diffstat (limited to 'addon/doxywizard/inputstrlist.cpp')
-rw-r--r-- | addon/doxywizard/inputstrlist.cpp | 69 |
1 files changed, 39 insertions, 30 deletions
diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp index fae45b5..cdc7d14 100644 --- a/addon/doxywizard/inputstrlist.cpp +++ b/addon/doxywizard/inputstrlist.cpp @@ -258,48 +258,57 @@ void InputStrList::writeValue(QTextStream &t,QTextCodec *codec) } } -#include <QMessageBox> bool InputStrList::isDefault() { - bool isEq = m_strList==m_default; + if (m_strList==m_default) return true; - if (!isEq) + auto it1 = m_strList.begin(); + auto it2 = m_default.begin(); + while (it1!=m_strList.end() && (*it1).isEmpty()) { - isEq = true; + ++it1; + } + while (it2!=m_default.end() && (*it2).isEmpty()) + { + ++it2; + } + // both lists are empty + if (it1==m_strList.end() && it2==m_default.end()) return true; - auto it1 = m_strList.begin(); - auto it2 = m_default.begin(); - while (it1!=m_strList.end() && it2!=m_default.end()) + // one list is empty but the other is not + if (it1==m_default.end()) return false; + if (it2==m_strList.end()) return false; + + it1 = m_strList.begin(); + it2 = m_default.begin(); + while (it1!=m_strList.end() && it2!=m_default.end()) + { + // skip over empty values + while (it1!=m_strList.end() && (*it1).isEmpty()) { - // skip over empty values - while (it1!=m_strList.end() && (*it1).isEmpty()) - { ++it1; - } - while (it2!=m_default.end() && (*it2).isEmpty()) - { - ++it2; - } - if ((it1!=m_strList.end()) && (it2!=m_default.end())) - { - if ((*it1).trimmed()!= (*it2).trimmed()) // difference so not the default - { - isEq=false; - break; - } - ++it1; - ++it2; - } - else if ((it1!=m_strList.end()) || (it2!=m_default.end())) + } + while (it2!=m_default.end() && (*it2).isEmpty()) + { + ++it2; + } + if ((it1!=m_strList.end()) && (it2!=m_default.end())) + { + if ((*it1).trimmed()!= (*it2).trimmed()) // difference so not the default { - // one list empty so cannot be the default - isEq=false; - break; + return false; } + ++it1; + ++it2; + } + else if ((it1!=m_strList.end()) || (it2!=m_default.end())) + { + // one list empty so cannot be the default + return false; } } - return isEq; + return true; } bool InputStrList::isEmpty() |