From c3e825b5a19b92ea3d3290f18657fb8e4808f57d Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 24 Dec 2020 16:56:32 -0500 Subject: [PATCH] Fix `--numbered` with `--no-toc` (Issue #405) --- CHANGES.md | 2 ++ htmldoc/htmldoc.cxx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 7e8cb54c..46ce3c91 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,8 @@ (Issue #396) - Fixed a regression in the handling of character entities for UTF-8 input (Issue #401) +- The `--numbered` option did not work when the table-of-contents was disabled + (Issue #405) # Changes in HTMLDOC v1.9.10 diff --git a/htmldoc/htmldoc.cxx b/htmldoc/htmldoc.cxx index 61298c74..2ccc4716 100644 --- a/htmldoc/htmldoc.cxx +++ b/htmldoc/htmldoc.cxx @@ -1271,9 +1271,16 @@ main(int argc, /* I - Number of command-line arguments */ */ if (OutputType == OUTPUT_BOOK && TocLevels > 0) + { toc = toc_build(document); + } else + { + if (TocNumbers) + htmlDeleteTree(toc_build(document)); + toc = NULL; + } htmlDebugStats("Table of Contents Tree", toc);