Skip to content

Commit 2e5aa57

Browse files
authored
Merge pull request doxygen#11529 from albert-github/feature/issue_11001
issue doxygen#11001 \copydoc does not respect section hierarchy in table of contents
2 parents 4f23d0d + abf9ae2 commit 2e5aa57

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/docnode.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,11 @@ DocRef::DocRef(DocParser *parser,DocNodeVariant *parent,const QCString &target,c
712712
m_relPath = parser->context.relPath;
713713
auto lang = parser->context.lang;
714714
const SectionInfo *sec = SectionManager::instance().find(parser->context.prefix+target);
715+
if (sec==nullptr && !parser->context.prefix.isEmpty())
716+
{
717+
sec = SectionManager::instance().find(target);
718+
}
719+
715720
if (sec==nullptr && getLanguageFromFileName(target)==SrcLangExt::Markdown) // lookup as markdown file
716721
{
717722
sec = SectionManager::instance().find(markdownFileNameToId(target));

src/util.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3298,6 +3298,13 @@ bool resolveLink(/* in */ const QCString &scName,
32983298
AUTO_TRACE_EXIT("section");
32993299
return TRUE;
33003300
}
3301+
else if ((si=SectionManager::instance().find(linkRef)))
3302+
{
3303+
*resContext=si->definition();
3304+
resAnchor = si->label();
3305+
AUTO_TRACE_EXIT("section");
3306+
return TRUE;
3307+
}
33013308
else if ((pd=Doxygen::exampleLinkedMap->find(linkRef))) // link to an example
33023309
{
33033310
*resContext=pd;

0 commit comments

Comments
 (0)