summaryrefslogtreecommitdiffstats
path: root/src/pagedef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pagedef.cpp')
-rw-r--r--src/pagedef.cpp71
1 files changed, 53 insertions, 18 deletions
diff --git a/src/pagedef.cpp b/src/pagedef.cpp
index 09152de..b0d375e 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -29,7 +29,7 @@
//------------------------------------------------------------------------------------------
-class PageDefImpl : public DefinitionImpl, public PageDef
+class PageDefImpl : public DefinitionMixin<PageDef>
{
public:
PageDefImpl(const char *f,int l,const char *n,const char *d,const char *t);
@@ -56,7 +56,7 @@ class PageDefImpl : public DefinitionImpl, public PageDef
virtual LocalToc localToc() const { return m_localToc; }
virtual void setPageScope(Definition *d){ m_pageScope = d; }
virtual Definition *getPageScope() const { return m_pageScope; }
- virtual QCString displayName(bool=TRUE) const { return hasTitle() ? m_title : DefinitionImpl::name(); }
+ virtual QCString displayName(bool=TRUE) const { return hasTitle() ? m_title : DefinitionMixin::name(); }
virtual bool showLineNo() const;
virtual void writeDocumentation(OutputList &ol);
virtual void writeTagFile(FTextStream &);
@@ -82,7 +82,7 @@ PageDef *createPageDef(const char *f,int l,const char *n,const char *d,const cha
PageDefImpl::PageDefImpl(const char *f,int l,const char *n,
const char *d,const char *t)
- : DefinitionImpl(f,l,1,n), m_title(t)
+ : DefinitionMixin(f,l,1,n), m_title(t)
{
setDocumentation(d,f,l);
m_subPageDict = new PageSDict(7);
@@ -99,6 +99,7 @@ PageDefImpl::~PageDefImpl()
void PageDefImpl::findSectionsInDocumentation()
{
+ docFindSections(briefDescription(),this,docFile());
docFindSections(documentation(),this,docFile());
}
@@ -121,21 +122,23 @@ void PageDefImpl::setFileName(const char *name)
m_fileName = name;
}
-void PageDefImpl::addInnerCompound(const Definition *const_def)
+void PageDefImpl::addInnerCompound(const Definition *def)
{
- if (const_def->definitionType()==Definition::TypePage)
+ if (def->definitionType()==Definition::TypePage)
{
- Definition *def = const_cast<Definition*>(const_def); // uck: fix me
- PageDef *pd = dynamic_cast<PageDef*>(def);
- m_subPageDict->append(pd->name(),pd);
- def->setOuterScope(this);
- if (this==Doxygen::mainPage)
+ PageDef *pd = const_cast<PageDef*>(toPageDef(def));
+ if (pd)
{
- pd->setNestingLevel(m_nestingLevel);
- }
- else
- {
- pd->setNestingLevel(m_nestingLevel+1);
+ m_subPageDict->append(pd->name(),pd);
+ pd->setOuterScope(this);
+ if (this==Doxygen::mainPage)
+ {
+ pd->setNestingLevel(m_nestingLevel);
+ }
+ else
+ {
+ pd->setNestingLevel(m_nestingLevel+1);
+ }
}
}
}
@@ -208,7 +211,11 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
{
if (getOuterScope()!=Doxygen::globalScope && !Config_getBool(DISABLE_INDEX))
{
- getOuterScope()->writeNavigationPath(ol);
+ DefinitionMutable *outerScope = toDefinitionMutable(getOuterScope());
+ if (outerScope)
+ {
+ outerScope->writeNavigationPath(ol);
+ }
}
ol.endQuickIndices();
}
@@ -229,7 +236,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
if (si->title() != manPageName)
{
- ol.generateDoc(docFile(),docLine(),this,0,si->title(),TRUE,FALSE,
+ ol.generateDoc(docFile(),getStartBodyLine(),this,0,si->title(),TRUE,FALSE,
0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
ol.endSection(si->label(),si->type());
}
@@ -249,7 +256,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
ol.startPageDoc(si->title());
//ol.startSection(si->label,si->title,si->type);
startTitle(ol,getOutputFileBase(),this);
- ol.generateDoc(docFile(),docLine(),this,0,si->title(),TRUE,FALSE,
+ ol.generateDoc(docFile(),getStartBodyLine(),this,0,si->title(),TRUE,FALSE,
0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
//stringToSearchIndex(getOutputFileBase(),
// theTranslator->trPage(TRUE,TRUE)+" "+si->title,
@@ -398,3 +405,31 @@ bool PageDefImpl::hasTitle() const
return !m_title.isEmpty() && m_title.lower()!="notitle";
}
+// --- Cast functions
+
+PageDef *toPageDef(Definition *d)
+{
+ if (d==0) return 0;
+ if (d && typeid(*d)==typeid(PageDefImpl))
+ {
+ return static_cast<PageDef*>(d);
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+const PageDef *toPageDef(const Definition *d)
+{
+ if (d==0) return 0;
+ if (d && typeid(*d)==typeid(PageDefImpl))
+ {
+ return static_cast<const PageDef*>(d);
+ }
+ else
+ {
+ return 0;
+ }
+}
+