]> git.lyx.org Git - lyx.git/blobdiff - src/Chktex.C
minimal effort implementation of:
[lyx.git] / src / Chktex.C
index 7956209a6e67c3b13701d2a7dccbbf02b931f92a..8ca81b294c1e3b784f36989859ecda70cd4ef22b 100644 (file)
 
 #include "LaTeX.h" // TeXErrors
 
-#include "support/BoostFormat.h"
+#include "support/convert.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
-#include "support/lyxlib.h"
 #include "support/systemcall.h"
 
+#include <boost/format.hpp>
+
 #include <fstream>
 
-using lyx::support::atoi;
-using lyx::support::ChangeExtension;
-using lyx::support::OnlyFilename;
+using lyx::support::changeExtension;
+using lyx::support::onlyFilename;
 using lyx::support::split;
 using lyx::support::Systemcall;
 
 using std::getline;
-
+using std::string;
 using std::ifstream;
 
 
@@ -43,7 +43,7 @@ Chktex::Chktex(string const & chktex, string const & f, string const & p)
 int Chktex::run(TeXErrors &terr)
 {
        // run bibtex
-       string log = OnlyFilename(ChangeExtension(file, ".log"));
+       string log = onlyFilename(changeExtension(file, ".log"));
        string tmp = cmd + " -q -v0 -b0 -x " + file + " -o " + log;
        Systemcall one;
        int result = one.startscript(Systemcall::Wait, tmp);
@@ -61,10 +61,10 @@ int Chktex::scanLogFile(TeXErrors & terr)
        string token;
        int retval = 0;
 
-       string const tmp = OnlyFilename(ChangeExtension(file, ".log"));
+       string const tmp = onlyFilename(changeExtension(file, ".log"));
 
 #if USE_BOOST_FORMAT
-       boost::format msg(STRCONV(_("ChkTeX warning id # %1$d")));
+       boost::format msg(_("ChkTeX warning id # %1$d"));
 #else
        string const msg(_("ChkTeX warning id # "));
 #endif
@@ -81,11 +81,11 @@ int Chktex::scanLogFile(TeXErrors & terr)
                token = split(token, warno, ':');
                token = split(token, warning, ':');
 
-               int const lineno = atoi(line);
+               int const lineno = convert<int>(line);
 
 #if USE_BOOST_FORMAT
                msg % warno;
-               terr.insertError(lineno, STRCONV(msg.str()), warning);
+               terr.insertError(lineno, msg.str(), warning);
                msg.clear();
 #else
                terr.insertError(lineno, msg + warno, warning);