X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=08f31484fe09e157821cbc0903c7487d0997b99a;hb=4089ff1ec36292a37866c81d844e9ebd6dffd850;hp=f4d238fb293299c15f813ba440a052defdfa5b02;hpb=b170b6e40fe38e79e97c049e7b727d75bd23ed52;p=lyx.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index f4d238fb29..08f31484fe 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2218,8 +2218,8 @@ void Buffer::validate(LaTeXFeatures & features) const if (!features.runparams().is_child) params().validate(features); - for_each(paragraphs().begin(), paragraphs().end(), - bind(&Paragraph::validate, _1, ref(features))); + for (Paragraph const & p : paragraphs()) + p.validate(features); if (lyxerr.debugging(Debug::LATEX)) { features.showStruct(); @@ -4622,6 +4622,11 @@ static depth_type getDepth(DocIterator const & it) if (!it[i].inset().inMathed()) depth += it[i].paragraph().getDepth() + 1; // remove 1 since the outer inset does not count + // we should have at least one non-math inset, so + // depth should nevery be 0. but maybe it is worth + // marking this, just in case. + LATTEST(depth > 0); + // coverity[INTEGER_OVERFLOW] return depth - 1; }