Skip to content

Commit

Permalink
Incorrect determination of sub-sections for index.
Browse files Browse the repository at this point in the history
Having an example like:
```
/*! \page commands Special Commands

\section cmd_intro Introduction

\section cmd_intro1 Introduction1

\anchor anc1

\section cmd_intro2 Introduction2
*/
```
the sections `Introduction` and `Introduction2` are shown as "pages" in the index of the CHM file but the section `Introduction1` is shown as a "book".

The problem is the `anchor` in the `Introduction1` section as an `anchor` (and `table`) are also handled with section references but should have been excluded here as it was done earlier for the current section for which the sub-sections are determined.
  • Loading branch information
albert-github committed Jun 10, 2022
1 parent 8863493 commit 593cc01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/definition.cpp
Expand Up @@ -372,10 +372,10 @@ void DefinitionImpl::addSectionsToIndex()
}
QCString title = si->title();
if (title.isEmpty()) title = si->label();
// determine if there is a next level inside this item
// determine if there is a next level inside this item, but be aware of the anchor and table section references.
auto it_next = std::next(it);
bool isDir = (it_next!=m_impl->sectionRefs.end()) ?
(static_cast<int>((*it_next)->type()) > nextLevel) : FALSE;
(isSection((*it_next)->type()) && static_cast<int>((*it_next)->type()) > nextLevel) : FALSE;
Doxygen::indexList->addContentsItem(isDir,title,
getReference(),
m_impl->def->getOutputFileBase(),
Expand Down

0 comments on commit 593cc01

Please sign in to comment.