]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlex_pimpl.C
* remove various xforms relicts, in particular:
[lyx.git] / src / lyxlex_pimpl.C
index e8e9e06befcc3f217ca7525526c4d1664941f5c2..481c579c9bb6a9a84f020f8fec28e8c9f2530ed0 100644 (file)
@@ -140,21 +140,18 @@ bool LyXLex::Pimpl::setFile(string const & filename)
        if (format == "gzip" || format == "zip" || format == "compress") {
                lyxerr[Debug::LYXLEX] << "lyxlex: compressed" << endl;
 
-#ifdef USE_COMPRESSION
                // The check only outputs a debug message, because it triggers
                // a bug in compaq cxx 6.2, where is_open() returns 'true' for
                // a fresh new filebuf.  (JMarc)
-               if (gz_.is_open() || istream::off_type(is.tellg()) > -1)
+               if (!gz_.empty() || istream::off_type(is.tellg()) > -1)
                        lyxerr[Debug::LYXLEX] << "Error in LyXLex::setFile: "
                                "file or stream already set." << endl;
-               gz_.open(filename.c_str(), ios::in);
+               gz_.push(io::gzip_decompressor());
+               gz_.push(io::file_source(filename));
                is.rdbuf(&gz_);
                name = filename;
                lineno = 0;
-               return gz_.is_open() && is.good();
-#else
-               return false;
-#endif
+               return gz_.component<io::file_source>(1)->is_open() && is.good();
        } else {
                lyxerr[Debug::LYXLEX] << "lyxlex: UNcompressed" << endl;