From 73e6d66a71c4534587fab81b0e48044887561f13 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Feb 05 2019 14:52:59 +0000 Subject: fixed bz#1671999, backported from upstream added test for XML output with an empty TOC --- diff --git a/doxygen-1.8.15-handle_empty_TOC_in_XML_output.patch b/doxygen-1.8.15-handle_empty_TOC_in_XML_output.patch new file mode 100644 index 0000000..dd90cdd --- /dev/null +++ b/doxygen-1.8.15-handle_empty_TOC_in_XML_output.patch @@ -0,0 +1,27 @@ +commit cfe381e3ee55b8291faeea55fe3b67bb9e545d60 +Author: Vladimír Vondruš +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 << " " << endl; +- SectionDict *sectionDict = pd->getSectionDict(); + SDict::Iterator li(*sectionDict); + SectionInfo *si; + int level=1,l; diff --git a/doxygen-1.8.15-test_for_XML_output_with_an_empty_TOC.patch b/doxygen-1.8.15-test_for_XML_output_with_an_empty_TOC.patch new file mode 100644 index 0000000..afa039d --- /dev/null +++ b/doxygen-1.8.15-test_for_XML_output_with_an_empty_TOC.patch @@ -0,0 +1,42 @@ +commit e26a5b8eed8a012e6a400f1ed6baf27980668b53 +Author: Vladimír Vondruš +Date: Sat Dec 29 21:30:51 2018 +0100 + + testing: add a test for XML output with an empty TOC. + + Fails, in particular causes Doxygen to produce an empty (or truncated) + XML file but returning with a success error code. + +diff --git a/testing/079/empty.xml b/testing/079/empty.xml +new file mode 100644 +index 00000000..3e1d6915 +--- /dev/null ++++ b/testing/079/empty.xml +@@ -0,0 +1,12 @@ ++ ++ ++ ++ empty ++ An empty page ++ ++ ++ ++With an empty TOC. ++ ++ ++ +diff --git a/testing/079_tableofcontents.dox b/testing/079_tableofcontents.dox +new file mode 100644 +index 00000000..499771d7 +--- /dev/null ++++ b/testing/079_tableofcontents.dox +@@ -0,0 +1,9 @@ ++// objective: test TOC generation for an empty page ++// check: empty.xml ++/** ++@page empty An empty page ++ ++@tableofcontents ++ ++With an empty TOC. ++*/ diff --git a/doxygen.spec b/doxygen.spec index d3f3e93..6ac914a 100644 --- a/doxygen.spec +++ b/doxygen.spec @@ -8,7 +8,7 @@ Summary: A documentation system for C/C++ Name: doxygen Epoch: 1 Version: 1.8.15 -Release: 2%{?dist} +Release: 3%{?dist} # No version is specified. License: GPL+ @@ -19,6 +19,8 @@ Source1: doxywizard.png Source2: doxywizard.desktop # upstream patches +Patch0: doxygen-1.8.15-handle_empty_TOC_in_XML_output.patch +Patch1: doxygen-1.8.15-test_for_XML_output_with_an_empty_TOC.patch BuildRequires: gcc-c++ gcc BuildRequires: perl-interpreter @@ -182,6 +184,10 @@ make tests -C %{_target_platform} %endif %changelog +* Tue Feb 05 2019 Than Ngo - 1:1.8.15-3 +- fixed bz#1671999, backported from upstream +- added test for XML output with an empty TOC + * Thu Jan 31 2019 Fedora Release Engineering - 1:1.8.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild