73e6d66a71
added test for XML output with an empty TOC
28 lines
964 B
Diff
28 lines
964 B
Diff
commit cfe381e3ee55b8291faeea55fe3b67bb9e545d60
|
|
Author: Vladimír Vondruš <mosra@centrum.cz>
|
|
Date: Sat Dec 29 21:52:39 2018 +0100
|
|
|
|
Properly handle empty TOC in XML output.
|
|
|
|
Caused the test (079) to fail with a SIGSEGV, but larger projects exit
|
|
with a success return code and the generated XML is either truncated or
|
|
empty. Weird.
|
|
|
|
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
|
|
index bacf4d41..033e611f 100644
|
|
--- a/src/xmlgen.cpp
|
|
+++ b/src/xmlgen.cpp
|
|
@@ -1818,10 +1818,10 @@ static void generateXMLForPage(PageDef *pd,FTextStream &ti,bool isExample)
|
|
}
|
|
}
|
|
writeInnerPages(pd->getSubPages(),t);
|
|
- if (pd->localToc().isXmlEnabled())
|
|
+ SectionDict *sectionDict = pd->getSectionDict();
|
|
+ if (pd->localToc().isXmlEnabled() && sectionDict)
|
|
{
|
|
t << " <tableofcontents>" << endl;
|
|
- SectionDict *sectionDict = pd->getSectionDict();
|
|
SDict<SectionInfo>::Iterator li(*sectionDict);
|
|
SectionInfo *si;
|
|
int level=1,l;
|