]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
- Correct library name in release build
[lyx.git] / src / buffer.C
index 3439e408dada1b75821a7f082122de395f94bcae..de2a6ac83bbeec15adb00b3a1c6fb8a3ba1bbedc 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"
@@ -79,6 +81,7 @@
 #include <iomanip>
 #include <stack>
 #include <sstream>
+#include <fstream>
 
 
 using lyx::pos_type;
@@ -136,15 +139,16 @@ extern BufferList bufferlist;
 
 namespace {
 
-int const LYX_FORMAT = 239;
+int const LYX_FORMAT = 240;
 
 } // namespace anon
 
 
 typedef std::map<string, bool> DepClean;
 
-struct Buffer::Impl
+class Buffer::Impl
 {
+public:
        Impl(Buffer & parent, string const & file, bool readonly);
 
        limited_stack<Undo> undostack;
@@ -416,7 +420,7 @@ int Buffer::readHeader(LyXLex & lex)
 
                string unknown = params().readToken(lex, token);
                if (!unknown.empty()) {
-                       if (unknown[0] != '\\' and token == "\\textclass") {
+                       if (unknown[0] != '\\' && token == "\\textclass") {
                                unknownClass(unknown);
                        } else {
                                ++unknown_tokens;
@@ -619,7 +623,8 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, pit_type const pit)
                                              filename));
                        return false;
                }
-               string command = LibFileSearch("lyx2lyx", "lyx2lyx");
+               string command =
+                       "python " + LibFileSearch("lyx2lyx", "lyx2lyx");
                if (command.empty()) {
                        Alert::error(_("Conversion script not found"),
                                     bformat(_("%1$s is from an earlier"
@@ -756,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)
@@ -1177,7 +1185,8 @@ void Buffer::validate(LaTeXFeatures & features) const
 {
        LyXTextClass const & tclass = params().getLyXTextClass();
 
-       if (params().tracking_changes) {
+       if (features.isAvailable("dvipost") && params().tracking_changes 
+               && params().output_changes) {
                features.require("dvipost");
                features.require("color");
        }
@@ -1457,7 +1466,9 @@ bool Buffer::isUnnamed() const
 }
 
 
+#ifdef WITH_WARNINGS
 #warning this function should be moved to buffer_pimpl.C
+#endif
 void Buffer::markDirty()
 {
        if (pimpl_->lyx_clean) {