diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2008-09-14 19:14:55 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2008-09-14 19:14:55 (GMT) |
commit | ec8cd7293a58213bac5967a3a3ccc7dc55ba19fe (patch) | |
tree | 7c2a1d6f7f4f4a314acdd54d620ac8a75519e369 /src/layout.cpp | |
parent | 1b605218ded157b8c128418fb86b0e53c8c3d452 (diff) | |
download | Doxygen-ec8cd7293a58213bac5967a3a3ccc7dc55ba19fe.zip Doxygen-ec8cd7293a58213bac5967a3a3ccc7dc55ba19fe.tar.gz Doxygen-ec8cd7293a58213bac5967a3a3ccc7dc55ba19fe.tar.bz2 |
Release-1.5.6-20080914
Diffstat (limited to 'src/layout.cpp')
-rw-r--r-- | src/layout.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/layout.cpp b/src/layout.cpp index 3a9949c..85b200f 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -32,6 +32,27 @@ static const char layout_default[] = #include "layout_default.h" ; +static bool elemIsVisible(const QXmlAttributes &attrib,bool defVal=TRUE) +{ + QCString visible = convertToQCString(attrib.value("visible")); + if (visible.isEmpty()) return defVal; + if (visible.at(0)=='$' && visible.length()>1) + { + QCString id = visible.mid(1); + ConfigOption *opt = Config::instance()->get(id); + if (opt && opt->kind()==ConfigOption::O_Bool) + { + return *((ConfigBool *)opt)->valueRef(); + } + else if (!opt) + { + err("Warning: found unsupported value %s for visible attribute in layout file\n", + visible.data()); + } + } + return visible!="no" && visible!="0"; +} + //--------------------------------------------------------------------------------- LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind) const @@ -658,8 +679,7 @@ class LayoutParser : public QXmlDefaultHandler void startSimpleEntry(LayoutDocEntry::Kind k,const QXmlAttributes &attrib) { - QCString visible = convertToQCString(attrib.value("visible")); - bool isVisible = visible.isEmpty() || (visible!="no" && visible!="0"); + bool isVisible = elemIsVisible(attrib); if (m_part!=-1 && isVisible) { LayoutDocManager::instance().addEntry((LayoutDocManager::LayoutPart)m_part, @@ -670,8 +690,7 @@ class LayoutParser : public QXmlDefaultHandler void startSectionEntry(LayoutDocEntry::Kind k,const QXmlAttributes &attrib, const QCString &title) { - QCString visible = convertToQCString(attrib.value("visible")); - bool isVisible = visible.isEmpty() || (visible!="no" && visible!="0"); + bool isVisible = elemIsVisible(attrib); QCString userTitle = convertToQCString(attrib.value("title")); //printf("startSectionEntry: title='%s' userTitle='%s'\n", // title.data(),userTitle.data()); @@ -704,8 +723,6 @@ class LayoutParser : public QXmlDefaultHandler void startMemberDefEntry(const QXmlAttributes &attrib,MemberList::ListType type, const QCString &title,const QCString &) { - //QCString visible = convertToQCString(attrib.value("visible")); - //bool isVisible = visible.isEmpty() || (visible!="no" && visible!="0"); QCString userTitle = convertToQCString(attrib.value("title")); if (userTitle.isEmpty()) userTitle = title; //printf("memberdef: %s\n",userTitle.data()); |