X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLexer.cpp;h=c4b738f119bcf13fe903d8a74df6e53e1514bc28;hb=f5b829bc8abf2e777d8dfc93400ae603d26d3a22;hp=664e1b9bfb6c10867b6981479a50d4d8b2c80fe2;hpb=ea50cd71f9dcf43cf75fbb06609d22abec3a1920;p=lyx.git diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 664e1b9bfb..c4b738f119 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -14,6 +14,7 @@ #include #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 @@ -570,7 +569,7 @@ void Lexer::Pimpl::pushToken(string const & pt) ////////////////////////////////////////////////////////////////////// Lexer::Lexer() - : pimpl_(new Pimpl(0, 0)) + : pimpl_(new Pimpl(0, 0)), lastReadOk_(false) {}