]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Beautify ToolTips in work area
[lyx.git] / src / Buffer.cpp
index f4d238fb293299c15f813ba440a052defdfa5b02..08f31484fe09e157821cbc0903c7487d0997b99a 100644 (file)
@@ -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;
 }