]> git.lyx.org Git - lyx.git/blobdiff - src/Lexer.cpp
tex2lyx/text.cpp: whitespace fix
[lyx.git] / src / Lexer.cpp
index d824da0364542253cbc713202cb616f5831b4d2c..06a3408f41e9591d77afabfbb3074d2f3b18d9de 100644 (file)
@@ -14,6 +14,7 @@
 #include <config.h>
 
 #include "Lexer.h"
+#include "Format.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
@@ -237,10 +238,14 @@ void Lexer::Pimpl::popTable()
 
 bool Lexer::Pimpl::setFile(FileName const & filename)
 {
+#ifdef TEX2LYX
+       // tex2lyx does not read lyxrc and therefore can't really check for
+       // zipped formats.
+       if (false) {
+#else
        // Check the format of the file.
-       string const format = filename.guessFormatFromContents();
-
-       if (format == "gzip" || format == "zip" || format == "compress") {
+       if (formats.isZippedFile(filename)) {
+#endif
                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 +279,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();