diff options
author | albert-github <albert.tests@gmail.com> | 2020-02-13 18:19:21 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-02-13 18:19:21 (GMT) |
commit | 9c9e30b295ca8b0a2130aa00c26bb5aa40a0e608 (patch) | |
tree | 218fc6102352a7ab4a1547e9dee9c6dfc686e2d5 | |
parent | 10b2b8fc694b60a17ccd2642f3a40c851e33b9da (diff) | |
download | Doxygen-9c9e30b295ca8b0a2130aa00c26bb5aa40a0e608.zip Doxygen-9c9e30b295ca8b0a2130aa00c26bb5aa40a0e608.tar.gz Doxygen-9c9e30b295ca8b0a2130aa00c26bb5aa40a0e608.tar.bz2 |
Unknown configuration enum values
In case we set for instance `DOT_IMAGE_FORMAT = SVG` (and generate call graphs) we get messages from the `dot` tool like:
```
error: Problems running dot: exit code=1, command='dot', arguments='".../example/html/test_8cpp_a764ac60c654173eb1a0afd0906ad5a12_icgraph.dot" -TSVG -o ".../example/html/test_8cpp_a764ac60c654173eb1a0afd0906ad5a12_icgraph.SVG"'
```
on other places (e.g `HTML_FORMULA_FORMAT`) and an unknown or enum value with a wrong case, the default value is (silently) taken.
We now check:
- is the enum value of the correct case otherwise (silently) set it to the correct case.
- in case of an unknown enum value a warning is given and the default value is used
-rw-r--r-- | src/configimpl.h | 1 | ||||
-rw-r--r-- | src/configimpl.l | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/configimpl.h b/src/configimpl.h index 6b85d8a..6134088 100644 --- a/src/configimpl.h +++ b/src/configimpl.h @@ -158,6 +158,7 @@ class ConfigEnum : public ConfigOption QCString *valueRef() { return &m_value; } void substEnvVars(); void writeTemplate(FTextStream &t,bool sl,bool); + void convertStrToVal(); void compareDoxyfile(FTextStream &t); void init() { m_value = m_defValue.copy(); } diff --git a/src/configimpl.l b/src/configimpl.l index daa7d90..eb33610 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -221,6 +221,25 @@ void ConfigBool::convertStrToVal() } } +void ConfigEnum::convertStrToVal() +{ + QCString val = m_value.stripWhiteSpace().lower(); + const char *s=m_valueRange.first(); + while (s) + { + if (QCString(s).lower() == val) + { + m_value = s; + return; + } + s = m_valueRange.next(); + } + + config_warn("argument '%s' for option %s is not a valid enum value\n" + "Using the default: %s!\n",m_value.data(),m_name.data(),m_defValue.data()); + m_value = m_defValue; +} + QCString &ConfigImpl::getString(const char *fileName,int num,const char *name) const { ConfigOption *opt = m_dict->find(name); |