Include child's own authors when using BufferParams from master.

This commit is contained in:
Juergen Spitzmueller 2014-03-13 06:43:38 +01:00
parent f9bf721aba
commit 7c1fc6ea75
4 changed files with 19 additions and 2 deletions

View File

@ -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();

View File

@ -510,6 +510,8 @@ public:
///
BufferParams & params();
BufferParams const & params() const;
///
BufferParams const & masterParams() const;
/** The list of paragraphs.
This is a linked list of paragraph, this list holds the

View File

@ -1451,7 +1451,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const
bool const is_command = layout_->latextype == LATEX_COMMAND;
Buffer const & buf = inset_owner_->buffer();
BufferParams const & bp = features.runparams().is_child
? buf.masterBuffer()->params() : buf.params();
? buf.masterParams() : buf.params();
Font f;
TexRow texrow;
// Using a string stream here circumvents the encoding

View File

@ -524,7 +524,7 @@ void TeXOnePar(Buffer const & buf,
int start_pos, int end_pos)
{
BufferParams const & bparams = runparams_in.is_child
? buf.masterBuffer()->params() : buf.params();
? buf.masterParams() : buf.params();
ParagraphList const & paragraphs = text.paragraphs();
Paragraph const & par = paragraphs.at(pit);
// FIXME This check should not really be needed.