Skip to content

Commit

Permalink
issue #10873 Setting BUILTIN_STL_SUPPORT to YES causes function page …
Browse files Browse the repository at this point in the history
…to not list all classes with Doxygen 1.8.18 and later
  • Loading branch information
doxygen committed May 18, 2024
1 parent c3c2d7e commit 78286a8
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 50 deletions.
4 changes: 2 additions & 2 deletions src/classdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4330,7 +4330,7 @@ void ClassDefImpl::sortMemberLists()
{
if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
}
std::sort(m_impl->innerClasses.begin(),
std::stable_sort(m_impl->innerClasses.begin(),
m_impl->innerClasses.end(),
[](const auto &c1,const auto &c2)
{
Expand Down Expand Up @@ -4702,7 +4702,7 @@ const MemberNameInfoLinkedMap &ClassDefImpl::memberNameInfoLinkedMap() const

void ClassDefImpl::sortAllMembersList()
{
std::sort(m_impl->allMemberNameInfoLinkedMap.begin(),
std::stable_sort(m_impl->allMemberNameInfoLinkedMap.begin(),
m_impl->allMemberNameInfoLinkedMap.end(),
[](const auto &m1,const auto &m2)
{
Expand Down
4 changes: 2 additions & 2 deletions src/definition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ static inline MemberVector refMapToVector(const std::unordered_map<std::string,M
{ return item.second; } // extract value to add from map Key,Value pair
);
// and sort it
std::sort(result.begin(),result.end(),
std::stable_sort(result.begin(),result.end(),
[](const auto &m1,const auto &m2) { return genericCompareMembers(m1,m2)<0; });
return result;
}
Expand Down Expand Up @@ -1385,7 +1385,7 @@ void DefinitionImpl::mergeRefItems(Definition *d)
otherXrefList.begin(),otherXrefList.end());

// sort results on itemId
std::sort(m_impl->xrefListItems.begin(),m_impl->xrefListItems.end(),
std::stable_sort(m_impl->xrefListItems.begin(),m_impl->xrefListItems.end(),
[](RefItem *left,RefItem *right)
{ return left->id() <right->id() ||
(left->id()==right->id() &&
Expand Down
10 changes: 5 additions & 5 deletions src/dirdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ void DirDefImpl::addFile(const FileDef *fd)

void DirDefImpl::sort()
{
std::sort(m_subdirs.begin(), m_subdirs.end(), compareDirDefs);
std::sort(m_fileList.begin(), m_fileList.end(), compareFileDefs);
std::stable_sort(m_subdirs.begin(), m_subdirs.end(), compareDirDefs);
std::stable_sort(m_fileList.begin(), m_fileList.end(), compareFileDefs);
}

static QCString encodeDirName(const QCString &anchor)
Expand Down Expand Up @@ -762,7 +762,7 @@ void DirDefImpl::computeDependencies()
}
}

std::sort(m_usedDirs.begin(),m_usedDirs.end(),
std::stable_sort(m_usedDirs.begin(),m_usedDirs.end(),
[](const auto &u1,const auto &u2)
{ return qstricmp(u1->dir()->getOutputFileBase(),u2->dir()->getOutputFileBase())<0; });

Expand Down Expand Up @@ -804,7 +804,7 @@ void UsedDir::addFileDep(const FileDef *srcFd,const FileDef *dstFd, bool srcDire

void UsedDir::sort()
{
std::sort(m_filePairs.begin(),
std::stable_sort(m_filePairs.begin(),
m_filePairs.end(),
[](const auto &left,const auto &right)
{
Expand Down Expand Up @@ -1101,7 +1101,7 @@ void buildDirectories()
}

// short the directories themselves
std::sort(Doxygen::dirLinkedMap->begin(),
std::stable_sort(Doxygen::dirLinkedMap->begin(),
Doxygen::dirLinkedMap->end(),
[](const auto &d1,const auto &d2)
{
Expand Down
2 changes: 1 addition & 1 deletion src/dotgfxhierarchytable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void DotGfxHierarchyTable::writeGraph(TextStream &out,
out << "<table border=\"0\" cellspacing=\"10\" cellpadding=\"0\">\n";

int count=0;
std::sort(m_rootSubgraphs.begin(),m_rootSubgraphs.end(),
std::stable_sort(m_rootSubgraphs.begin(),m_rootSubgraphs.end(),
[](auto n1,auto n2) { return qstricmp(n1->label(),n2->label())<0; });
for (auto n : m_rootSubgraphs)
{
Expand Down
22 changes: 11 additions & 11 deletions src/doxygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10003,7 +10003,7 @@ static void generateDiskNames()
else if (size>1) // multiple occurrences of the same file name
{
// sort the array
std::sort(fileEntries.begin(),
std::stable_sort(fileEntries.begin(),
fileEntries.end(),
[](const FileEntry &fe1,const FileEntry &fe2)
{ return fe1.path < fe2.path; }
Expand Down Expand Up @@ -10534,7 +10534,7 @@ static void readDir(FileInfo *fi,
if (resultList && !dirResultList.empty())
{
// sort the resulting list to make the order platform independent.
std::sort(dirResultList.begin(),
std::stable_sort(dirResultList.begin(),
dirResultList.end(),
[](const auto &f1,const auto &f2) { return qstricmp(f1.c_str(),f2.c_str())<0; });

Expand Down Expand Up @@ -11739,7 +11739,7 @@ void searchInputFiles()
}

// Sort the FileDef objects by full path to get a predictable ordering over multiple runs
std::sort(Doxygen::inputNameLinkedMap->begin(),
std::stable_sort(Doxygen::inputNameLinkedMap->begin(),
Doxygen::inputNameLinkedMap->end(),
[](const auto &f1,const auto &f2)
{
Expand All @@ -11749,7 +11749,7 @@ void searchInputFiles()
{
if (fileName->size()>1)
{
std::sort(fileName->begin(),fileName->end(),[](const auto &f1,const auto &f2)
std::stable_sort(fileName->begin(),fileName->end(),[](const auto &f1,const auto &f2)
{
return qstricmp(f1->absFilePath(),f2->absFilePath())<0;
});
Expand Down Expand Up @@ -12275,22 +12275,22 @@ void parseInput()
};

g_s.begin("Sorting lists...\n");
std::sort(Doxygen::memberNameLinkedMap->begin(),
std::stable_sort(Doxygen::memberNameLinkedMap->begin(),
Doxygen::memberNameLinkedMap->end(),
memberNameComp);
std::sort(Doxygen::functionNameLinkedMap->begin(),
std::stable_sort(Doxygen::functionNameLinkedMap->begin(),
Doxygen::functionNameLinkedMap->end(),
memberNameComp);
std::sort(Doxygen::hiddenClassLinkedMap->begin(),
std::stable_sort(Doxygen::hiddenClassLinkedMap->begin(),
Doxygen::hiddenClassLinkedMap->end(),
classComp);
std::sort(Doxygen::classLinkedMap->begin(),
std::stable_sort(Doxygen::classLinkedMap->begin(),
Doxygen::classLinkedMap->end(),
classComp);
std::sort(Doxygen::conceptLinkedMap->begin(),
std::stable_sort(Doxygen::conceptLinkedMap->begin(),
Doxygen::conceptLinkedMap->end(),
conceptComp);
std::sort(Doxygen::namespaceLinkedMap->begin(),
std::stable_sort(Doxygen::namespaceLinkedMap->begin(),
Doxygen::namespaceLinkedMap->end(),
namespaceComp);
g_s.end();
Expand Down Expand Up @@ -12402,7 +12402,7 @@ void parseInput()

if (Config_getBool(SORT_GROUP_NAMES))
{
std::sort(Doxygen::groupLinkedMap->begin(),
std::stable_sort(Doxygen::groupLinkedMap->begin(),
Doxygen::groupLinkedMap->end(),
[](const auto &g1,const auto &g2)
{ return g1->groupTitle() < g2->groupTitle(); });
Expand Down
12 changes: 6 additions & 6 deletions src/filedef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ void FileDefImpl::sortMemberLists()
if (mlg.needsSorting()) { mlg.sort(); mlg.setNeedsSorting(FALSE); }
}

std::sort(m_includedByList.begin(),m_includedByList.end(),
std::stable_sort(m_includedByList.begin(),m_includedByList.end(),
[](const auto &fi1,const auto &fi2) { return fi1.includeName < fi2.includeName; });

if (Config_getBool(SORT_BRIEF_DOCS))
Expand All @@ -1677,17 +1677,17 @@ void FileDefImpl::sortMemberLists()
qstricmp(c1->className(), c2->className())<0;
};

std::sort(m_classes.begin(), m_classes.end(), classComp);
std::sort(m_interfaces.begin(),m_interfaces.end(),classComp);
std::sort(m_structs.begin(), m_structs.end(), classComp);
std::sort(m_exceptions.begin(),m_exceptions.end(),classComp);
std::stable_sort(m_classes.begin(), m_classes.end(), classComp);
std::stable_sort(m_interfaces.begin(),m_interfaces.end(),classComp);
std::stable_sort(m_structs.begin(), m_structs.end(), classComp);
std::stable_sort(m_exceptions.begin(),m_exceptions.end(),classComp);

auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
{
return qstricmp(n1->name(),n2->name())<0;
};

std::sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ftvhelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ static void generateJSNavTree(const FTVNodes &nodeList)
t << "];\n\n";

// write the navigation index (and sub-indices)
std::sort(navIndex.begin(),navIndex.end(),[](const auto &n1,const auto &n2)
std::stable_sort(navIndex.begin(),navIndex.end(),[](const auto &n1,const auto &n2)
{ return !n1.url.isEmpty() && (n2.url.isEmpty() || (n1.url<n2.url)); });

int subIndex=0;
Expand Down
8 changes: 4 additions & 4 deletions src/groupdef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1820,22 +1820,22 @@ void GroupDefImpl::sortMemberLists()
}
if (Config_getBool(SORT_BRIEF_DOCS))
{
std::sort(m_dirList.begin(), m_dirList.end(), compareDirDefs);
std::stable_sort(m_dirList.begin(), m_dirList.end(), compareDirDefs);

auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
{
return Config_getBool(SORT_BY_SCOPE_NAME) ?
qstricmp(c1->name(), c2->name())<0 :
qstricmp(c1->className(), c2->className())<0;
};
std::sort(m_classes.begin(), m_classes.end(), classComp);
std::stable_sort(m_classes.begin(), m_classes.end(), classComp);

auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
{
return qstricmp(n1->name(),n2->name())<0;
};

std::sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
std::stable_sort(m_namespaces.begin(),m_namespaces.end(),namespaceComp);
}
else
{
Expand Down Expand Up @@ -1886,7 +1886,7 @@ void GroupDefImpl::removeMemberFromList(MemberListType lt,MemberDef *md)

void GroupDefImpl::sortSubGroups()
{
std::sort(m_groups.begin(),
std::stable_sort(m_groups.begin(),
m_groups.end(),
[](const auto &g1,const auto &g2)
{ return g1->groupTitle() < g2->groupTitle(); });
Expand Down
2 changes: 1 addition & 1 deletion src/htmlhelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static QCString convertToHtmlAndTruncate(const QCString &s)
*/
void HtmlHelpIndex::writeFields(std::ostream &t)
{
std::sort(std::begin(m_map),
std::stable_sort(std::begin(m_map),
std::end(m_map),
[](const auto &e1,const auto &e2) { return e1->name < e2->name; }
);
Expand Down
36 changes: 30 additions & 6 deletions src/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,30 @@ void Index::sortMemberIndexLists()
{
for (auto &[name,list] : map)
{
std::sort(list.begin(),list.end(),
std::stable_sort(list.begin(),list.end(),
[](const MemberDef *md1,const MemberDef *md2)
{
// consider candidates A::a, B::b, B::a, A::b, A::A, B::B,
// want after sorting: A::A, A::a, B::a, B::B, A::b, B::b
// so we can later group entries
// - A: A
// - a: A, B
// - B: B
// - b: A, B
int result = qstricmp(md1->name(),md2->name());
return result==0 ? qstricmp(md1->qualifiedName(),md2->qualifiedName())<0 : result<0;
if (result==0) // next: compare case sensitive, see issue #10873
{
result = qstrcmp(md1->name(),md2->name());
}
if (result==0) // next compare with full scope
{
result = qstricmp(md1->qualifiedName(),md2->qualifiedName());
}
if (result==0)
{
result = qstrcmp(md1->qualifiedName(),md2->qualifiedName());
}
return result<0;
});
}
};
Expand Down Expand Up @@ -1577,13 +1596,13 @@ static void writeFileIndex(OutputList &ol)
}

// sort the files by path
std::sort(outputFiles.begin(),
std::stable_sort(outputFiles.begin(),
outputFiles.end(),
[](const auto &fp1,const auto &fp2) { return qstricmp(fp1.path,fp2.path)<0; });
// sort the files inside the directory by name
for (auto &fp : outputFiles)
{
std::sort(fp.files.begin(), fp.files.end(), compareFileDefs);
std::stable_sort(fp.files.begin(), fp.files.end(), compareFileDefs);
}
// write the results
for (const auto &fp : outputFiles)
Expand Down Expand Up @@ -2298,12 +2317,17 @@ static void writeAlphabeticalClassList(OutputList &ol, ClassDef::CompoundType ct
// sort the class lists per letter while ignoring the prefix
for (auto &[letter,list] : classesByLetter)
{
std::sort(list.begin(), list.end(),
std::stable_sort(list.begin(), list.end(),
[](const auto &c1,const auto &c2)
{
QCString n1 = c1->className();
QCString n2 = c2->className();
return qstricmp(n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2))<0;
int result = qstricmp(n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2));
if (result==0)
{
result = qstrcmp(n1.data()+getPrefixIndex(n1), n2.data()+getPrefixIndex(n2));
}
return result<0;
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/memberlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class MemberVector
}
void sort()
{
std::sort(m_members.begin(),m_members.end(),lessThan);
std::stable_sort(m_members.begin(),m_members.end(),lessThan);
}
void inSort(MemberDef *md)
{
Expand Down
6 changes: 3 additions & 3 deletions src/moduledef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,15 +731,15 @@ void ModuleDefImpl::sortMemberLists()
qstricmp(c1->name(), c2->name())<0 :
qstricmp(c1->className(), c2->className())<0;
};
std::sort(m_classes.begin(), m_classes.end(), classComp);
std::stable_sort(m_classes.begin(), m_classes.end(), classComp);

auto conceptComp = [](const ConceptLinkedRefMap::Ptr &c1,const ConceptLinkedRefMap::Ptr &c2)
{
return Config_getBool(SORT_BY_SCOPE_NAME) ?
qstricmp(c1->qualifiedName(), c2->qualifiedName())<0 :
qstricmp(c1->name(), c2->name())<0;
};
std::sort(m_concepts.begin(), m_concepts.end(), conceptComp);
std::stable_sort(m_concepts.begin(), m_concepts.end(), conceptComp);
}

static auto contrComp = [](const ModuleDef *m1, const ModuleDef *m2)
Expand Down Expand Up @@ -767,7 +767,7 @@ void ModuleDefImpl::sortMemberLists()
return tr1<tr2 || (tr1==tr2 && diff<0);
};

std::sort(m_contributing.begin(), m_contributing.end(), contrComp);
std::stable_sort(m_contributing.begin(), m_contributing.end(), contrComp);
}

void ModuleDefImpl::writeSummaryLinks(OutputList &ol) const
Expand Down
10 changes: 5 additions & 5 deletions src/namespacedef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,18 +1461,18 @@ void NamespaceDefImpl::sortMemberLists()
qstricmp(c1->className(), c2->className())<0;
};

std::sort(classes.begin(), classes.end(), classComp);
std::sort(interfaces.begin(),interfaces.end(),classComp);
std::sort(structs.begin(), structs.end(), classComp);
std::sort(exceptions.begin(),exceptions.end(),classComp);
std::stable_sort(classes.begin(), classes.end(), classComp);
std::stable_sort(interfaces.begin(),interfaces.end(),classComp);
std::stable_sort(structs.begin(), structs.end(), classComp);
std::stable_sort(exceptions.begin(),exceptions.end(),classComp);


auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
{
return qstricmp(n1->name(),n2->name())<0;
};

std::sort(namespaces.begin(),namespaces.end(),namespaceComp);
std::stable_sort(namespaces.begin(),namespaces.end(),namespaceComp);
}

MemberList *NamespaceDefImpl::getMemberList(MemberListType lt) const
Expand Down
15 changes: 15 additions & 0 deletions src/qcstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,21 @@ inline std::string toStdString(const QCString &s)

//---- overloads

inline int qstrcmp( const QCString &str1, const char *str2 )
{
return qstrcmp(str1.data(),str2);
}

inline int qstrcmp( const char *str1, const QCString &str2 )
{
return qstrcmp(str1,str2.data());
}

inline int qstrcmp( const QCString &str1, const QCString &str2 )
{
return qstrcmp(str1.data(),str2.data());
}

inline int qstricmp( const QCString &str1, const char *str2 )
{
return qstricmp(str1.data(),str2);
Expand Down

0 comments on commit 78286a8

Please sign in to comment.