X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=cbd46266e938c09351e11982e02dfd00165fb41e;hb=53f8d6d6d373460bdcfebd20d6f826e3915c84ff;hp=d3aa876e770ee731574f5b58eeb9b35991476725;hpb=fa6b388cb3b77995a88ef98987b542ee7bf5d98f;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d3aa876e77..cbd46266e9 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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(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;