]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Fixing bugs 1844,1845: doc settings don't stick
[lyx.git] / src / buffer.C
index 9287b877badee5cd4171f149eb58dac8a5534a45..f33c70bbf6dcb629e2bf0dc2b853095f42864342 100644 (file)
@@ -13,6 +13,7 @@
 #include "buffer.h"
 
 #include "author.h"
+#include "BranchList.h"
 #include "buffer_funcs.h"
 #include "bufferlist.h"
 #include "bufferparams.h"
@@ -395,6 +396,20 @@ int Buffer::readHeader(LyXLex & lex)
        int line = -1;
        int begin_header_line = -1;
 
+       // Initialize parameters that may be/go lacking in header:
+       params().branchlist().clear();
+       params().options.erase();
+       params().float_placement.erase();
+       params().paperwidth.erase();
+       params().paperheight.erase();
+       params().leftmargin.erase();
+       params().rightmargin.erase();
+       params().topmargin.erase();
+       params().bottommargin.erase();
+       params().headheight.erase();
+       params().headsep.erase();
+       params().footskip.erase();
+
        while (lex.isOK()) {
                lex.next();
                string const token = lex.getString();
@@ -857,6 +872,8 @@ void Buffer::makeLaTeXFile(ostream & os,
                if (!original_path.empty()) {
                        string inputpath = os::external_path(original_path);
                        subst(inputpath, "~", "\\string~");
+                       if (inputpath.find(' ') != string::npos)
+                               inputpath = '"' + inputpath + '"';
                        os << "\\makeatletter\n"
                            << "\\def\\input@path{{"
                            << inputpath << "/}}\n"