summaryrefslogtreecommitdiffstats
path: root/src/doxygen.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2018-06-24 08:53:54 (GMT)
committerGitHub <noreply@github.com>2018-06-24 08:53:54 (GMT)
commit22af92975d880c13b9bb08cd829ff7fba4d09160 (patch)
tree61843c4fb320ee52fa3dbf10098709963e22f15d /src/doxygen.cpp
parent358b1b3cd4dacb6a8c5a10d933c943623f20a1ba (diff)
parent5d89de25fa5aa146ab65a88f09a7cc729dea3e51 (diff)
downloadDoxygen-22af92975d880c13b9bb08cd829ff7fba4d09160.zip
Doxygen-22af92975d880c13b9bb08cd829ff7fba4d09160.tar.gz
Doxygen-22af92975d880c13b9bb08cd829ff7fba4d09160.tar.bz2
Merge pull request #763 from albert-github/feature/bug_formula_repository
Resolve inconsistency in formula repositories.
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r--src/doxygen.cpp52
1 files changed, 44 insertions, 8 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 29b889e..7ad8c52 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -9752,14 +9752,17 @@ int readFileOrDirectory(const char *s,
//----------------------------------------------------------------------------
-void readFormulaRepository()
+void readFormulaRepository(QCString dir, bool cmp)
{
- QFile f(Config_getString(HTML_OUTPUT)+"/formula.repository");
+ static int current_repository = 0;
+ int new_repository = 0;
+ QFile f(dir+"/formula.repository");
if (f.open(IO_ReadOnly)) // open repository
{
msg("Reading formula repository...\n");
QTextStream t(&f);
QCString line;
+ Formula *f;
while (!t.eof())
{
line=t.readLine().utf8();
@@ -9773,14 +9776,42 @@ void readFormulaRepository()
{
QCString formName = line.left(se);
QCString formText = line.right(line.length()-se-1);
- Formula *f=new Formula(formText);
- Doxygen::formulaList->setAutoDelete(TRUE);
- Doxygen::formulaList->append(f);
- Doxygen::formulaDict->insert(formText,f);
- Doxygen::formulaNameDict->insert(formName,f);
+ if (cmp)
+ {
+ if ((f=Doxygen::formulaDict->find(formText))==0)
+ {
+ err("discrepancy between formula repositories! Remove "
+ "formula.repository and from_* files from output directories.");
+ exit(1);
+ }
+ QCString formLabel;
+ formLabel.sprintf("\\form#%d",f->getId());
+ if (formLabel != formName)
+ {
+ err("discrepancy between formula repositories! Remove "
+ "formula.repository and from_* files from output directories.");
+ exit(1);
+ }
+ new_repository++;
+ }
+ else
+ {
+ f=new Formula(formText);
+ Doxygen::formulaList->setAutoDelete(TRUE);
+ Doxygen::formulaList->append(f);
+ Doxygen::formulaDict->insert(formText,f);
+ Doxygen::formulaNameDict->insert(formName,f);
+ current_repository++;
+ }
}
}
}
+ if (cmp && (current_repository != new_repository))
+ {
+ err("size discrepancy between formula repositories! Remove "
+ "formula.repository and from_* files from output directories.");
+ exit(1);
+ }
}
//----------------------------------------------------------------------------
@@ -11070,7 +11101,12 @@ void parseInput()
if (Config_getBool(GENERATE_HTML))
{
- readFormulaRepository();
+ readFormulaRepository(Config_getString(HTML_OUTPUT));
+ }
+ if (Config_getBool(GENERATE_RTF))
+ {
+ // in case GENERRATE_HTML is set we just have to compare, both repositories should be identical
+ readFormulaRepository(Config_getString(RTF_OUTPUT),Config_getBool(GENERATE_HTML));
}
/**************************************************************************