diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2019-12-23 12:38:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-23 12:38:56 (GMT) |
commit | 7125e98bfb413bbede8d7568072b6006f17c6cbd (patch) | |
tree | 24b71d463c2b846d2a3c1bb43551132dd10c8acf /src/docparser.cpp | |
parent | 2beef53594232109e75f7daab2b2c059f2531bd6 (diff) | |
parent | 5576550317561f0fc33c26db144d0bea5561bc9f (diff) | |
download | Doxygen-7125e98bfb413bbede8d7568072b6006f17c6cbd.zip Doxygen-7125e98bfb413bbede8d7568072b6006f17c6cbd.tar.gz Doxygen-7125e98bfb413bbede8d7568072b6006f17c6cbd.tar.bz2 |
Merge pull request #7211 from albert-github/feature/issue_7210
issue #7210: 1.8.16: Image inclusion is inconsistent
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r-- | src/docparser.cpp | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index f4160ef..a1509fc 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -287,8 +287,17 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool bool ambig; FileDef *fd; //printf("Search for %s\n",fileName); - if ((fd=findFileDef(Doxygen::imageNameDict,fileName,ambig)) && !ambig) + if (fd=findFileDef(Doxygen::imageNameDict,fileName,ambig)) { + if (ambig & dowarn) + { + QCString text; + text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName)); + text+="Possible candidates:\n"; + text+=showFileDefMatches(Doxygen::imageNameDict,fileName); + warn_doc_error(g_fileName,doctokenizerYYlineno,text); + } + QCString inputFile = fd->absFilePath(); QFile inImage(inputFile); if (inImage.open(IO_ReadOnly)) @@ -378,17 +387,6 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool return baseName; } } - else if (ambig) - { - if (dowarn) - { - QCString text; - text.sprintf("image file name %s is ambiguous.\n",qPrint(fileName)); - text+="Possible candidates:\n"; - text+=showFileDefMatches(Doxygen::imageNameDict,fileName); - warn_doc_error(g_fileName,doctokenizerYYlineno,text); - } - } else { result=fileName; @@ -1844,16 +1842,16 @@ static void readTextFileByName(const QCString &file,QCString &text) // as a fallback we also look in the exampleNameDict bool ambig; FileDef *fd; - if ((fd=findFileDef(Doxygen::exampleNameDict,file,ambig)) && !ambig) + if (fd=findFileDef(Doxygen::exampleNameDict,file,ambig)) { text = fileToString(fd->absFilePath(),Config_getBool(FILTER_SOURCE_FILES)); - } - else if (ambig) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"included file name %s is ambiguous" + if (ambig) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"included file name %s is ambiguous" "Possible candidates:\n%s",qPrint(file), qPrint(showFileDefMatches(Doxygen::exampleNameDict,file)) ); + } } else { @@ -2749,17 +2747,17 @@ bool DocDotFile::parse() { fd = findFileDef(Doxygen::dotFileNameDict,m_name+".dot",ambig); } - if (fd && !ambig) + if (fd) { m_file = fd->absFilePath(); ok = true; - } - else if (ambig) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"included dot file name %s is ambiguous.\n" + if (ambig) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"included dot file name %s is ambiguous.\n" "Possible candidates:\n%s",qPrint(m_name), qPrint(showFileDefMatches(Doxygen::dotFileNameDict,m_name)) ); + } } else { @@ -2786,17 +2784,17 @@ bool DocMscFile::parse() { fd = findFileDef(Doxygen::mscFileNameDict,m_name+".msc",ambig); } - if (fd && !ambig) + if (fd) { m_file = fd->absFilePath(); ok = true; - } - else if (ambig) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"included msc file name %s is ambiguous.\n" + if (ambig) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"included msc file name %s is ambiguous.\n" "Possible candidates:\n%s",qPrint(m_name), qPrint(showFileDefMatches(Doxygen::mscFileNameDict,m_name)) ); + } } else { @@ -2825,17 +2823,17 @@ bool DocDiaFile::parse() { fd = findFileDef(Doxygen::diaFileNameDict,m_name+".dia",ambig); } - if (fd && !ambig) + if (fd) { m_file = fd->absFilePath(); ok = true; - } - else if (ambig) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"included dia file name %s is ambiguous.\n" + if (ambig) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"included dia file name %s is ambiguous.\n" "Possible candidates:\n%s",qPrint(m_name), qPrint(showFileDefMatches(Doxygen::diaFileNameDict,m_name)) ); + } } else { |