/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
+ * ======================================================
+ *
+ * LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
* This file is Copyright 1997-1998
* Asger Alstrup
*
- * ======================================================
+ * ======================================================
*/
#include <config.h>
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
#include "Chktex.h"
#include "LaTeX.h" // TeXErrors
#include "lyxlex.h"
#include "support/path.h"
#include "support/lstrings.h"
+#include "support/BoostFormat.h"
+
#include <fstream>
using std::ifstream;
// run bibtex
string log = OnlyFilename(ChangeExtension(file, ".log"));
string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
- Systemcall one;
+ Systemcall one;
int result= one.startscript(Systemcall::Wait, tmp);
if (result == 0) {
result = scanLogFile(terr);
string token;
int retval = 0;
- string tmp = OnlyFilename(ChangeExtension(file, ".log"));
+ string const tmp = OnlyFilename(ChangeExtension(file, ".log"));
+#if USE_BOOST_FORMAT
+ boost::format msg(_("ChkTeX warning id # %1$d"));
+#else
+ string const msg(_("ChkTeX warning id # "));
+#endif
ifstream ifs(tmp.c_str());
while (getline(ifs, token)) {
string srcfile;
token = split(token, warno, ':');
token = split(token, warning, ':');
- int lineno = lyx::atoi(line);
- warno = _("ChkTeX warning id #") + warno;
- terr.insertError(lineno, warno, warning);
+ int const lineno = lyx::atoi(line);
+
+#if USE_BOOST_FORMAT
+ msg % warno;
+ terr.insertError(lineno, msg.str(), warning);
+ msg.clear();
+#else
+ terr.insertError(lineno, msg + warno, warning);
+#endif
+
++retval;
}
return retval;