Here's my take on Asger's patch.
--
Angus
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2095
diff -u -p -r1.2095 ChangeLog
--- src/ChangeLog 20 Jan 2005 16:17:34 -0000 1.2095
+++ src/ChangeLog 20 Jan 2005 19:42:22 -0000
@@ -1,3 +1,10 @@
+2005-01-20 Asger Ottar Alstrup <[EMAIL PROTECTED]>
+
+ * buffer.C:
+ * lyxlex_pimpl.[Ch]: use USE_COMPRESSION guard.
+
+ * output_plaintext.C: remove unneeded #include gzstream.h.
+
2005-01-20 Angus Leeming <[EMAIL PROTECTED]>
* SpellBase.h: rename some of the elements of the Result enum.
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.605
diff -u -p -r1.605 buffer.C
--- src/buffer.C 20 Jan 2005 16:17:35 -0000 1.605
+++ src/buffer.C 20 Jan 2005 19:42:23 -0000
@@ -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 & fn
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: src/lyxlex_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxlex_pimpl.C,v
retrieving revision 1.46
diff -u -p -r1.46 lyxlex_pimpl.C
--- src/lyxlex_pimpl.C 19 Jan 2005 15:03:29 -0000 1.46
+++ src/lyxlex_pimpl.C 20 Jan 2005 19:42:24 -0000
@@ -140,6 +140,7 @@ bool LyXLex::Pimpl::setFile(string const
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
name = filename;
lineno = 0;
return gz_.is_open() && is.good();
+#else
+ return false;
+#endif
} else {
lyxerr[Debug::LYXLEX] << "lyxlex: UNcompressed" << endl;
Index: src/lyxlex_pimpl.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxlex_pimpl.h,v
retrieving revision 1.20
diff -u -p -r1.20 lyxlex_pimpl.h
--- src/lyxlex_pimpl.h 19 Jan 2005 15:03:29 -0000 1.20
+++ src/lyxlex_pimpl.h 20 Jan 2005 19:42:24 -0000
@@ -14,10 +14,13 @@
#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: src/output_plaintext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/output_plaintext.C,v
retrieving revision 1.9
diff -u -p -r1.9 output_plaintext.C
--- src/output_plaintext.C 16 Aug 2004 00:32:00 -0000 1.9
+++ src/output_plaintext.C 20 Jan 2005 19:42:24 -0000
@@ -22,8 +22,9 @@
#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;