diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2018-12-31 14:39:00 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2018-12-31 14:39:00 (GMT) |
commit | 36b69fbd6ada3764daad8c7c0b880b6bb3784a48 (patch) | |
tree | 0b575b6fe39fcb9b2fb33ea6b18d88bc1bc9bf27 | |
parent | d57ce63ad7dc2bc61d05980e984408f1b63ff59d (diff) | |
parent | ddd5dac97e2dc0af0976a765ea405ba24e136349 (diff) | |
download | Doxygen-36b69fbd6ada3764daad8c7c0b880b6bb3784a48.zip Doxygen-36b69fbd6ada3764daad8c7c0b880b6bb3784a48.tar.gz Doxygen-36b69fbd6ada3764daad8c7c0b880b6bb3784a48.tar.bz2 |
Merge branch 'mosra-invalid-xml-for-empty-toc'
-rw-r--r-- | src/xmlgen.cpp | 2 | ||||
-rw-r--r-- | testing/079/empty.xml | 12 | ||||
-rw-r--r-- | testing/079/levels.xml | 41 | ||||
-rw-r--r-- | testing/079_tableofcontents.dox | 26 |
4 files changed, 80 insertions, 1 deletions
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 44061f6..033e611 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1819,7 +1819,7 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample) } writeInnerPages(pd->getSubPages(),t); SectionDict *sectionDict = pd->getSectionDict(); - if (sectionDict && pd->localToc().isXmlEnabled()) + if (pd->localToc().isXmlEnabled() && sectionDict) { t << " <tableofcontents>" << endl; SDict<SectionInfo>::Iterator li(*sectionDict); diff --git a/testing/079/empty.xml b/testing/079/empty.xml new file mode 100644 index 0000000..3e1d691 --- /dev/null +++ b/testing/079/empty.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> + <compounddef id="empty" kind="page"> + <compoundname>empty</compoundname> + <title>An empty page</title> + <briefdescription> + </briefdescription> + <detaileddescription> +<para>With an empty TOC. </para> + </detaileddescription> + </compounddef> +</doxygen> diff --git a/testing/079/levels.xml b/testing/079/levels.xml new file mode 100644 index 0000000..bbb4232 --- /dev/null +++ b/testing/079/levels.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version=""> + <compounddef id="levels" kind="page"> + <compoundname>levels</compoundname> + <title>A page with two-level TOC</title> + <tableofcontents> + <tocsect> + <name>A section that's in TOC</name> + <reference>levels_1first</reference> + <tableofcontents> + <tocsect> + <name>A subsection that's in TOC</name> + <reference>levels_1first2</reference> + </tocsect> + </tableofcontents> + </tocsect> + <tocsect> + <name>A section that's in TOC again</name> + <reference>levels_1second</reference> + </tocsect> + </tableofcontents> + <briefdescription> + </briefdescription> + <detaileddescription> + <sect1 id="levels_1first"> + <title>A section that's in TOC</title> + <sect2 id="levels_1first2"> + <title>A subsection that's in TOC</title> + <sect3 id="levels_1first3"> + <title>A subsubsection that's not in TOC</title> + <para>Nay!</para> + </sect3> + </sect2> + </sect1> + <sect1 id="levels_1second"> + <title>A section that's in TOC again</title> + <para>Yay! </para> + </sect1> + </detaileddescription> + </compounddef> +</doxygen> diff --git a/testing/079_tableofcontents.dox b/testing/079_tableofcontents.dox new file mode 100644 index 0000000..7512463 --- /dev/null +++ b/testing/079_tableofcontents.dox @@ -0,0 +1,26 @@ +// objective: test TOC generation for an empty page +// check: empty.xml +// check: levels.xml +/** +@page empty An empty page + +@tableofcontents + +With an empty TOC. +*/ + +/** +@page levels A page with two-level TOC + +@tableofcontents{xml:2} + +@section first A section that's in TOC +@subsection first2 A subsection that's in TOC +@subsubsection first3 A subsubsection that's not in TOC + +Nay! + +@section second A section that's in TOC again + +Yay! +*/ |