]> git.lyx.org Git - lyx.git/commitdiff
use USE_COMPRESSION to guard code.
authorAngus Leeming <leeming@lyx.org>
Thu, 20 Jan 2005 21:34:23 +0000 (21:34 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 20 Jan 2005 21:34:23 +0000 (21:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9516 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/buffer.C
src/lyxlex_pimpl.C
src/lyxlex_pimpl.h
src/output_plaintext.C

index 73b407350e241a47c1b6d9d4273fcfc8f613d47d..fe359efd195f8a707b7c80e736141f0d6c826891 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-20  Asger Ottar Alstrup  <aalstrup@laerdal.dk>
+
+       * buffer.C:
+       * lyxlex_pimpl.[Ch]: use USE_COMPRESSION guard.
+
+       * output_plaintext.C: remove unneeded #include gzstream.h.
+       
 2005-01-20  Angus Leeming  <leeming@lyx.org>
 
        * SpellBase.h: rename some of the elements of the Result enum.
index d93d9ac832b3ace9bcb2a5f5f64ccc1eb296f6bc..fabaa9e0ed15f27ae49e780c66fbecd9c9848892 100644 (file)
@@ -65,7 +65,9 @@
 
 #include "support/FileInfo.h"
 #include "support/filetools.h"
-#include "support/gzstream.h"
+#ifdef USE_COMPRESSION
+# include "support/gzstream.h"
+#endif
 #include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/path.h"
@@ -759,12 +761,15 @@ bool Buffer::writeFile(string const & fname) const
        bool retval = false;
 
        if (params().compressed) {
+#ifdef USE_COMPRESSION
                gz::ogzstream ofs(fname.c_str());
                if (!ofs)
                        return false;
 
                retval = do_writeFile(ofs);
-
+#else
+               return false;
+#endif
        } else {
                ofstream ofs(fname.c_str());
                if (!ofs)
index 81a6e65c010fb0564a10d435b9e5e21b7c1bbc6b..292778761a44a3bd87fc7d77c3a8b60e4b91fc6e 100644 (file)
@@ -140,6 +140,7 @@ 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)
@@ -151,6 +152,9 @@ bool LyXLex::Pimpl::setFile(string const & filename)
                name = filename;
                lineno = 0;
                return gz_.is_open() && is.good();
+#else
+               return false;
+#endif
        } else {
                lyxerr[Debug::LYXLEX] << "lyxlex: UNcompressed" << endl;
 
index 681c0a746ff82ce9d43d7f459a86019527fa0bc4..d95367f75d0e6bb91cae082c32fb1bcbd3feec40 100644 (file)
 
 #include "lyxlex.h"
 
-#include "support/gzstream.h"
+#ifdef USE_COMPRESSION
+# include "support/gzstream.h"
+#endif
 
 #include <boost/utility.hpp>
 
+#include <istream>
 #include <stack>
 #include <vector>
 
@@ -56,8 +59,11 @@ public:
        void pushToken(std::string const &);
        /// fb_ is only used to open files, the stream is accessed through is.
        std::filebuf fb_;
+
+#ifdef HAVE_COMPRESSION
        /// gz_ is only used to open files, the stream is accessed through is.
        gz::gzstreambuf gz_;
+#endif
 
        /// the stream that we use.
        std::istream is;
index d0da1d04dc56c3310efd38fc54b6169842dce883..4b4be01ad14d6cad4174e114ff223bbf74315b0d 100644 (file)
 #include "ParagraphList_fwd.h"
 #include "ParagraphParameters.h"
 
-#include "support/gzstream.h"
 #include "support/lstrings.h"
 
+#include <fstream>
+
 using lyx::support::ascii_lowercase;
 using lyx::support::compare_ascii_no_case;
 using lyx::support::compare_no_case;