]> git.lyx.org Git - lyx.git/blobdiff - src/Lexer.cpp
Fix two thinkos caught by the cppcheck script.
[lyx.git] / src / Lexer.cpp
index d824da0364542253cbc713202cb616f5831b4d2c..df2ce6913100ef292cb1c5f8f22f16fe92acff33 100644 (file)
@@ -14,6 +14,7 @@
 #include <config.h>
 
 #include "Lexer.h"
+#include "Format.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
@@ -238,9 +239,7 @@ void Lexer::Pimpl::popTable()
 bool Lexer::Pimpl::setFile(FileName const & filename)
 {
        // Check the format of the file.
-       string const format = filename.guessFormatFromContents();
-
-       if (format == "gzip" || format == "zip" || format == "compress") {
+       if (formats.isZippedFile(filename)) {
                LYXERR(Debug::LYXLEX, "lyxlex: compressed");
                // The check only outputs a debug message, because it triggers
                // a bug in compaq cxx 6.2, where is_open() returns 'true' for
@@ -274,9 +273,9 @@ bool Lexer::Pimpl::setFile(FileName const & filename)
 
        // Skip byte order mark.
        if (is.peek() == 0xef) {
-               int c = is.get();
+               is.get();
                if (is.peek() == 0xbb) {
-                       c = is.get();
+                       is.get();
                        LASSERT(is.get() == 0xbf, /**/);
                } else
                        is.unget();