diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2018-10-27 13:09:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-27 13:09:54 (GMT) |
commit | f6c992ac55da299e8acbafeea1672d40424ba2c5 (patch) | |
tree | 99bae3fa09a0971c4ae73c74d19e88290b8b93da | |
parent | 82149767a751243875d0d50cf0a31ee9714ed100 (diff) | |
parent | 887db516c1b0163139db971c5aa720804cc23f37 (diff) | |
download | Doxygen-f6c992ac55da299e8acbafeea1672d40424ba2c5.zip Doxygen-f6c992ac55da299e8acbafeea1672d40424ba2c5.tar.gz Doxygen-f6c992ac55da299e8acbafeea1672d40424ba2c5.tar.bz2 |
Merge pull request #6542 from albert-github/feature/bug_751700
Bug 751700 - Main page absent in TOC of CHM, if PROJECT_NAME is empty
-rw-r--r-- | src/config.h | 2 | ||||
-rw-r--r-- | src/configimpl.h | 6 | ||||
-rw-r--r-- | src/configimpl.l | 14 |
3 files changed, 19 insertions, 3 deletions
diff --git a/src/config.h b/src/config.h index 98f5a92..102774e 100644 --- a/src/config.h +++ b/src/config.h @@ -66,7 +66,7 @@ namespace Config * and replaces environment variables. * \param clearHeaderAndFooter set to TRUE when writing header and footer templates. */ - void postProcess(bool clearHeaderAndFooter); + void postProcess(bool clearHeaderAndFooter, bool compare = FALSE); /*! Check the validity of the parsed options and correct or warn the user where needed. */ void checkAndCorrect(); diff --git a/src/configimpl.h b/src/configimpl.h index ef8bb21..1594d47 100644 --- a/src/configimpl.h +++ b/src/configimpl.h @@ -75,6 +75,7 @@ class ConfigOption virtual void writeTemplate(FTextStream &t,bool sl,bool upd) = 0; virtual void compareDoxyfile(FTextStream &t) = 0; virtual void convertStrToVal() {} + virtual void emptyValueToDefault() {} virtual void substEnvVars() = 0; virtual void init() {} @@ -189,6 +190,7 @@ class ConfigString : public ConfigOption void compareDoxyfile(FTextStream &t); void substEnvVars(); void init() { m_value = m_defValue.copy(); } + void emptyValueToDefault() { if(m_value.isEmpty()) m_value=m_defValue; }; private: QCString m_value; @@ -491,6 +493,10 @@ class ConfigImpl */ void convertStrToVal(); + /*! Sets default value in case value is empty + */ + void emptyValueToDefault(); + /*! Replaces references to environment variable by the actual value * of the environment variable. */ diff --git a/src/configimpl.l b/src/configimpl.l index 0779e70..ed5b052 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -983,6 +983,15 @@ void ConfigImpl::convertStrToVal() option->convertStrToVal(); } } +void ConfigImpl::emptyValueToDefault() +{ + QListIterator<ConfigOption> it = iterator(); + ConfigOption *option; + for (;(option=it.current());++it) + { + option->emptyValueToDefault(); + } +} static void substEnvVarsInString(QCString &s) { @@ -1854,7 +1863,7 @@ void Config::writeTemplate(FTextStream &t,bool shortList,bool update) void Config::compareDoxyfile(FTextStream &t) { - postProcess(FALSE); + postProcess(FALSE, TRUE); ConfigImpl::instance()->compareDoxyfile(t); } @@ -1863,9 +1872,10 @@ bool Config::parse(const char *fileName,bool update) return ConfigImpl::instance()->parse(fileName,update); } -void Config::postProcess(bool clearHeaderAndFooter) +void Config::postProcess(bool clearHeaderAndFooter, bool compare) { ConfigImpl::instance()->substituteEnvironmentVars(); + if (!compare)ConfigImpl::instance()->emptyValueToDefault(); ConfigImpl::instance()->convertStrToVal(); // avoid bootstrapping issues when the config file already |