summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-08-24 18:31:30 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-08-24 18:31:30 (GMT)
commit745955f576cbd7b5f7601c55937d9c42db8161e8 (patch)
tree0e25070a82332a8c68e61938df6d7258d4a1d481 /src
parentfdd1c3f1527b15f6b0a25c2d99748f6a8adc5fcf (diff)
downloadDoxygen-745955f576cbd7b5f7601c55937d9c42db8161e8.zip
Doxygen-745955f576cbd7b5f7601c55937d9c42db8161e8.tar.gz
Doxygen-745955f576cbd7b5f7601c55937d9c42db8161e8.tar.bz2
Bug 735145 - QHP toc broken if mainpage with PROJECT_NAME title has sections/subpages
Diffstat (limited to 'src')
-rw-r--r--src/index.cpp15
-rw-r--r--src/qhp.cpp12
-rw-r--r--src/qhp.h3
3 files changed, 22 insertions, 8 deletions
diff --git a/src/index.cpp b/src/index.cpp
index 430f5af..c1c2837 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -3079,6 +3079,17 @@ static void countRelatedPages(int &docPages,int &indexPages)
//----------------------------------------------------------------------------
+static bool mainPageHasOwnTitle()
+{
+ static QCString projectName = Config_getString("PROJECT_NAME");
+ QCString title;
+ if (Doxygen::mainPage)
+ {
+ title = filterTitle(Doxygen::mainPage->title());
+ }
+ return !projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0;
+}
+
static void writePages(PageDef *pd,FTVHelp *ftv)
{
//printf("writePages()=%s pd=%p mainpage=%p\n",pd->name().data(),pd,Doxygen::mainPage);
@@ -3115,8 +3126,8 @@ static void writePages(PageDef *pd,FTVHelp *ftv)
}
}
if (hasSubPages && ftv) ftv->incContentsDepth();
- bool doIndent = (hasSections || hasSubPages) &&
- (pd!=Doxygen::mainPage || mainPageHasTitle());
+ bool doIndent = (hasSections || hasSubPages) &&
+ (pd!=Doxygen::mainPage || mainPageHasOwnTitle());
if (doIndent)
{
Doxygen::indexList->incContentsDepth();
diff --git a/src/qhp.cpp b/src/qhp.cpp
index 9e6cc5d..757f547 100644
--- a/src/qhp.cpp
+++ b/src/qhp.cpp
@@ -53,7 +53,7 @@ static QCString makeRef(const char * withoutExtension, const char * anchor)
return result+"#"+anchor;
}
-Qhp::Qhp() : m_prevSectionLevel(0), m_sectionLevel(0)
+Qhp::Qhp() : m_prevSectionLevel(0), m_sectionLevel(0), m_skipMainPageSection(FALSE)
{
m_doc.setIndentLevel(0);
m_toc.setIndentLevel(2);
@@ -177,14 +177,13 @@ void Qhp::finalize()
void Qhp::incContentsDepth()
{
m_sectionLevel++;
- //printf("Qhp::incContentsDepth() %d->%d\n",m_sectionLevel-1,m_sectionLevel);
}
void Qhp::decContentsDepth()
{
- //printf("Qhp::decContentsDepth() %d->%d\n",m_sectionLevel,m_sectionLevel-1);
- if (m_sectionLevel <= 0)
+ if (m_sectionLevel<=0 || (m_sectionLevel==1 && m_skipMainPageSection))
{
+ m_skipMainPageSection=FALSE;
return;
}
m_sectionLevel--;
@@ -208,6 +207,7 @@ void Qhp::addContentsItem(bool /*isDir*/, const char * name,
setPrevSection(name, f, anchor, m_sectionLevel);
// Close sections as needed
+ //printf("Qhp::addContentsItem() closing %d sections\n",diff);
for (; diff > 0; diff--)
{
m_toc.close("section");
@@ -331,6 +331,10 @@ void Qhp::handlePrevSection()
m_toc.openClose("section", attributes);
}
}
+ else
+ {
+ m_skipMainPageSection=TRUE;
+ }
clearPrevSection();
}
diff --git a/src/qhp.h b/src/qhp.h
index a428ac4..2c4e2c9 100644
--- a/src/qhp.h
+++ b/src/qhp.h
@@ -64,8 +64,7 @@ class Qhp : public IndexIntf
int m_prevSectionLevel;
int m_sectionLevel;
- //QCString m_prevIdName;
- //QCString m_prevIdRef;
+ bool m_skipMainPageSection;
};
#endif // DOXYGEN_QHP_H