]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Squash some warnings.
[lyx.git] / src / TextMetrics.cpp
index 66e100b2d90202684ed5317f2cdd3eaaf24be116..b40cb5553010a2d298a2842b5d5ae7d1236a2dad 100644 (file)
@@ -481,6 +481,11 @@ bool TextMetrics::redoParagraph(pit_type const pit)
        if (text_->isMainText()) {
                if (pit == 0) {
                        pm.rows().front().dimension().asc += 20;
+                       /* coverity[copy_paste_error]: coverity thinks that we
+                        * should update pm.dim().asc below, but all the rows
+                        * heights are actually counted as part of the paragraph metric
+                        * descent see loop above).
+                        */
                        pm.dim().des += 20;
                }
                ParagraphList const & pars = text_->paragraphs();
@@ -928,7 +933,7 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
        // if the row is too large, try to cut at last separator. In case
        // of success, reset indication that the row was broken abruptly.
        if (row.shortenIfNeeded(body_pos, width))
-               row.right_boundary(false);
+               row.right_boundary(!row.empty() && row.back().endpos == row.endpos());
 
        // make sure that the RTL elements are in reverse ordering
        row.reverseRTL(is_rtl);