X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=3a6ae648b25885b5009da363c47659c56098b58e;hb=33f9cfb7961501b38c573eede468b011687f46de;hp=4f397efc5ecf29d593a0fecedade8424b42bb834;hpb=9cb98136ceeb3fbda70aa5beea4cf3f5ea26a36c;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 4f397efc5e..3a6ae648b2 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1771,7 +1771,7 @@ Buffer::ExportStatus Buffer::makeLaTeXFile(FileName const & fname, catch (EncodingException const & e) { docstring const failed(1, e.failed_char); ostringstream oss; - oss << "0x" << hex << e.failed_char << dec; + oss << "0x" << hex << static_cast(e.failed_char) << dec; if (getParFromID(e.par_id).paragraph().layout().pass_thru) { docstring msg = bformat(_("Uncodable character '%1$s'" " (code point %2$s)"), @@ -2592,18 +2592,16 @@ void Buffer::collectBibKeys(FileNameList & checkedFiles) const } -void Buffer::addBiblioInfo(BiblioInfo const & bin) const +void Buffer::addBiblioInfo(BiblioInfo const & bi_in) const { - // We add the biblio info to the master buffer, - // if there is one, but also to every single buffer, - // in case a child is compiled alone. - BiblioInfo & bi = d->bibinfo_; - bi.mergeBiblioInfo(bin); + // We add the biblio info to the parent buffer, + // if there is one, but also to this buffer, in case + // it is compiled alone. + BiblioInfo & our_bi = d->bibinfo_; + our_bi.mergeBiblioInfo(bi_in); - if (parent() != nullptr) { - BiblioInfo & masterbi = parent()->d->bibinfo_; - masterbi.mergeBiblioInfo(bin); - } + if (parent()) + parent()->addBiblioInfo(bi_in); } @@ -3138,6 +3136,11 @@ ParConstIterator Buffer::par_iterator_end() const return ParConstIterator(doc_iterator_end(this)); } +bool Buffer::empty() const +{ + return paragraphs().size() == 1 && paragraphs().front().empty(); +} + Language const * Buffer::language() const {