Annotate source code to please coverity

This code is signalled as a copy and paste error, but it is a false
positive.

According to the documentation, adding a comment starting with
  // coverity[name_of_error]
should be enough to flag the false positive.
This commit is contained in:
Jean-Marc Lasgouttes 2016-06-09 15:51:07 +02:00
parent 5e5440f2f3
commit 731dbddd11

View File

@ -481,6 +481,11 @@ bool TextMetrics::redoParagraph(pit_type const pit)
if (text_->isMainText()) { if (text_->isMainText()) {
if (pit == 0) { if (pit == 0) {
pm.rows().front().dimension().asc += 20; 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; pm.dim().des += 20;
} }
ParagraphList const & pars = text_->paragraphs(); ParagraphList const & pars = text_->paragraphs();