]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Make layout test compile
[lyx.git] / src / Buffer.cpp
index d3aa876e770ee731574f5b58eeb9b35991476725..cbd46266e938c09351e11982e02dfd00165fb41e 100644 (file)
@@ -58,7 +58,6 @@
 #include "SpellChecker.h"
 #include "sgml.h"
 #include "TexRow.h"
-#include "TexStream.h"
 #include "Text.h"
 #include "TextClass.h"
 #include "TocBackend.h"
@@ -354,6 +353,7 @@ private:
 /// Creates the per buffer temporary directory
 static FileName createBufferTmpDir()
 {
+       // FIXME THREAD
        static int count;
        // We are in our own directory.  Why bother to mangle name?
        // In fact I wrote this code to circumvent a problematic behaviour
@@ -636,6 +636,21 @@ BufferParams const & Buffer::params() const
 }
 
 
+BufferParams const & Buffer::masterParams() const
+{
+       if (masterBuffer() == this)
+               return params();
+
+       BufferParams & mparams = const_cast<Buffer *>(masterBuffer())->params();
+       // Copy child authors to the params. We need those pointers.
+       AuthorList const & child_authors = params().authors();
+       AuthorList::Authors::const_iterator it = child_authors.begin();
+       for (; it != child_authors.end(); it++)
+               mparams.authors().record(*it);
+       return mparams;
+}
+
+
 ParagraphList & Buffer::paragraphs()
 {
        return text().paragraphs();
@@ -913,7 +928,7 @@ bool Buffer::readDocument(Lexer & lex)
 
        readHeader(lex);
 
-       if (params().outputChanges) {
+       if (params().output_changes) {
                bool dvipost    = LaTeXFeatures::isAvailable("dvipost");
                bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
                                  LaTeXFeatures::isAvailable("xcolor");
@@ -994,7 +1009,8 @@ bool Buffer::importString(string const & format, docstring const & contents, Err
        TempFile const tempfile("Buffer_importStringXXXXXX." + fmt->extension());
        FileName const name(tempfile.name());
        ofdocstream os(name.toFilesystemEncoding().c_str());
-       bool const success = (os << contents);
+       // Do not convert os implicitly to bool, since that is forbidden in C++11.
+       bool const success = !(os << contents).fail();
        os.close();
 
        bool converted = false;
@@ -1484,7 +1500,6 @@ bool Buffer::makeLaTeXFile(FileName const & fname,
        if (!openFileWrite(ofs, fname))
                return false;
 
-       //TexStream ts(ofs.rdbuf(), &texrow());
        ErrorList & errorList = d->errorLists["Export"];
        errorList.clear();
        bool failed_export = false;