summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/context.cpp2
-rw-r--r--src/definition.cpp9
-rw-r--r--src/docbookgen.cpp2
-rw-r--r--src/docparser.cpp2
-rw-r--r--src/ftvhelp.cpp2
-rw-r--r--src/groupdef.cpp2
-rw-r--r--src/pagedef.cpp8
-rw-r--r--src/pagedef.h4
-rw-r--r--src/rtfgen.cpp2
-rw-r--r--src/searchindex.cpp2
-rw-r--r--src/sqlite3gen.cpp2
-rw-r--r--src/util.cpp7
-rw-r--r--src/xmlgen.cpp4
13 files changed, 26 insertions, 22 deletions
diff --git a/src/context.cpp b/src/context.cpp
index 6b5d2ac..8a3a784 100644
--- a/src/context.cpp
+++ b/src/context.cpp
@@ -7807,7 +7807,7 @@ class NavPathElemContext::Private
{
text = ((const GroupDef*)m_def)->groupTitle();
}
- else if (type==Definition::TypePage && !(((const PageDef*)m_def)->title().isEmpty()))
+ else if (type==Definition::TypePage && (((const PageDef*)m_def)->hasTitle()))
{
text = ((const PageDef*)m_def)->title();
}
diff --git a/src/definition.cpp b/src/definition.cpp
index 276d02f..62a4e69 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -1694,7 +1694,7 @@ QCString Definition::pathFragment() const
{
result+=((const GroupDef*)this)->groupTitle();
}
- else if (definitionType()==Definition::TypePage && !((const PageDef*)this)->title().isEmpty())
+ else if (definitionType()==Definition::TypePage && ((const PageDef*)this)->hasTitle())
{
result+=((const PageDef*)this)->title();
}
@@ -1737,11 +1737,10 @@ QCString Definition::navigationPathAsString() const
result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
convertToHtml(((const GroupDef*)this)->groupTitle())+"</a>";
}
- else if (definitionType()==Definition::TypePage && !((const PageDef*)this)->title().isEmpty())
+ else if (definitionType()==Definition::TypePage && ((const PageDef*)this)->hasTitle())
{
- if ((this==Doxygen::mainPage && mainPageHasTitle()) || this!=Doxygen::mainPage)
- result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
- convertToHtml(((const PageDef*)this)->title())+"</a>";
+ result+="<a class=\"el\" href=\"$relpath^"+getOutputFileBase()+Doxygen::htmlFileExtension+"\">"+
+ convertToHtml(((const PageDef*)this)->title())+"</a>";
}
else if (definitionType()==Definition::TypeClass)
{
diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp
index 97c602d..011ef12 100644
--- a/src/docbookgen.cpp
+++ b/src/docbookgen.cpp
@@ -635,7 +635,7 @@ DB_GEN_C
if (!pd->getGroupDef() && !pd->isReference() && pd->name() == stripPath(name))
{
t << "<chapter>\n";
- if (!pd->title().isEmpty())
+ if (pd->hasTitle())
{
t << " <title>" << convertToDocBook(pd->title()) << "</title>" << endl;
}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a5c0cc7..082ba75 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -7586,7 +7586,7 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
case Definition::TypePage:
{
PageDef *pd = (PageDef *)ctx;
- if (!pd->title().isEmpty())
+ if (pd->hasTitle())
{
name = theTranslator->trPage(TRUE,TRUE)+" "+pd->title();
}
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index ea57eb7..97bcdcc 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -657,7 +657,7 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
QCString &projName = Config_getString(PROJECT_NAME);
if (projName.isEmpty())
{
- if (Doxygen::mainPage && !Doxygen::mainPage->title().isEmpty()) // Use title of main page as root
+ if (mainPageHasTitle()) // Use title of main page as root
{
t << "\"" << convertToJSString(Doxygen::mainPage->title()) << "\", ";
}
diff --git a/src/groupdef.cpp b/src/groupdef.cpp
index e543d16..397b254 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -963,7 +963,7 @@ void GroupDef::writePageDocumentation(OutputList &ol)
if (!pd->isReference())
{
SectionInfo *si=0;
- if (!pd->title().isEmpty() && !pd->name().isEmpty() &&
+ if (pd->hasTitle() && !pd->name().isEmpty() &&
(si=Doxygen::sectionDict->find(pd->name()))!=0)
{
ol.startSection(si->label,si->title,SectionInfo::Subsection);
diff --git a/src/pagedef.cpp b/src/pagedef.cpp
index 79a78d3..93d5817 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -190,7 +190,7 @@ void PageDef::writeDocumentation(OutputList &ol)
ol.disable(OutputGenerator::Docbook);
ol.disable(OutputGenerator::RTF);
ol.disable(OutputGenerator::Man);
- if (!title().isEmpty() && !name().isEmpty() && si!=0)
+ if (hasTitle() && !name().isEmpty() && si!=0)
{
ol.startPageDoc(si->title);
//ol.startSection(si->label,si->title,si->type);
@@ -342,3 +342,9 @@ bool PageDef::showLineNo() const
{
return m_showLineNo;
}
+
+bool PageDef::hasTitle() const
+{
+ return !m_title.isEmpty() && m_title.lower()!="notitle";
+}
+
diff --git a/src/pagedef.h b/src/pagedef.h
index a0c3acb..e958617 100644
--- a/src/pagedef.h
+++ b/src/pagedef.h
@@ -60,10 +60,12 @@ class PageDef : public Definition
bool documentedPage() const;
bool hasSubPages() const;
bool hasParentPage() const;
+ bool hasTitle() const;
LocalToc localToc() const { return m_localToc; }
void setPageScope(Definition *d){ m_pageScope = d; }
Definition *getPageScope() const { return m_pageScope; }
- QCString displayName(bool=TRUE) const { return !m_title.isEmpty() ? m_title : Definition::name(); }
+ QCString displayName(bool=TRUE) const
+ { return hasTitle() ? m_title : Definition::name(); }
bool showLineNo() const;
void writeDocumentation(OutputList &ol);
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 2e67c26..b42780f 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -665,7 +665,7 @@ void RTFGenerator::endIndexSection(IndexSections is)
break;
case isMainPage:
t << "\\par " << rtf_Style_Reset << endl;
- if (!Doxygen::mainPage || Doxygen::mainPage->title().isEmpty())
+ if (!mainPageHasTitle())
{
t << "{\\tc \\v " << theTranslator->trMainPage() << "}"<< endl;
}
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 5859d67..52378cd 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -117,7 +117,7 @@ void SearchIndex::setCurrentDoc(Definition *ctx,const char *anchor,bool isSource
case Definition::TypePage:
{
PageDef *pd = (PageDef *)ctx;
- if (!pd->title().isEmpty())
+ if (pd->hasTitle())
{
name = theTranslator->trPage(TRUE,TRUE)+" "+pd->title();
}
diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp
index a7b8dbb..eceea06 100644
--- a/src/sqlite3gen.cpp
+++ b/src/sqlite3gen.cpp
@@ -2478,7 +2478,7 @@ static void generateSqlite3ForPage(const PageDef *pd,bool isExample)
QCString title;
if (pd==Doxygen::mainPage) // main page is special
{
- if (!pd->title().isEmpty() && pd->title().lower()!="notitle")
+ if (mainPageHasTitle())
{
title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title()));
}
diff --git a/src/util.cpp b/src/util.cpp
index 08c13fb..24e8898 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6674,7 +6674,7 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
if (gd) gd->addPage(pd);
- if (!pd->title().isEmpty())
+ if (pd->hasTitle())
{
//outputList->writeTitle(pi->name,pi->title);
@@ -8919,10 +8919,7 @@ void convertProtectionLevel(
bool mainPageHasTitle()
{
- if (Doxygen::mainPage==0) return FALSE;
- if (Doxygen::mainPage->title().isEmpty()) return FALSE;
- if (Doxygen::mainPage->title().lower()=="notitle") return FALSE;
- return TRUE;
+ return Doxygen::mainPage!=0 && Doxygen::mainPage->hasTitle();
}
QCString getDotImageExtension(void)
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 033e611..8b8e648 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -1797,11 +1797,11 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
if (pd==Doxygen::mainPage) // main page is special
{
QCString title;
- if (!pd->title().isEmpty() && pd->title().lower()!="notitle")
+ if (mainPageHasTitle())
{
title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title()));
}
- else
+ else
{
title = Config_getString(PROJECT_NAME);
}