X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=1ccb263014651595f417bb099d9ea820c8a4b522;hb=bea9d2f3f774d62aa48fe83ebbefdd0e7d5f85b9;hp=3fe0b9bce20a8667d28c8ace9d668cbefd66e241;hpb=a43d8501a2ce9649ec7394e14f1c45b877ff7a90;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 3fe0b9bce2..1ccb263014 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -664,7 +664,6 @@ void Buffer::cloneWithChildren(BufferMap & bufmap, CloneList_ptr clones) const buffer_clone->setChild(dit, child_clone); } buffer_clone->d->macro_lock = false; - return; } @@ -1549,9 +1548,8 @@ bool Buffer::save() const // time stamp is invalidated by copying/moving saveCheckSum(); markClean(); - if (d->file_format != LYX_FORMAT) - // the file associated with this buffer is now in the current format - d->file_format = LYX_FORMAT; + // the file associated with this buffer is now in the current format + d->file_format = LYX_FORMAT; return true; } // else we saved the file, but failed to move it to the right location. @@ -1905,9 +1903,9 @@ Buffer::ExportStatus Buffer::writeLaTeXSource(otexstream & os, docstring uncodable_glyphs; Encoding const * const enc = runparams.encoding; if (enc) { - for (size_t n = 0; n < inputpath.size(); ++n) { - if (!enc->encodable(inputpath[n])) { - docstring const glyph(1, inputpath[n]); + for (char_type n : inputpath) { + if (!enc->encodable(n)) { + docstring const glyph(1, n); LYXERR0("Uncodable character '" << glyph << "' in input path!"); @@ -4011,10 +4009,7 @@ InsetLabel const * Buffer::insetLabel(docstring const & label, bool Buffer::activeLabel(docstring const & label) const { - if (!insetLabel(label, true)) - return false; - - return true; + return insetLabel(label, true) != nullptr; }