]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.C
* src/frontends/qt4/QTocDialog.C (updateGui):
[lyx.git] / src / TextMetrics.C
index 9b9876d3b79127e3483e016e4262d7e9a6eac269..4d5add998c00577d8c9a7702c040d717e13a65b1 100644 (file)
@@ -85,18 +85,16 @@ int numberOfLabelHfills(Paragraph const & par, Row const & row)
 
 int numberOfHfills(Paragraph const & par, Row const & row)
 {
-       pos_type last = row.endpos();
+       pos_type const last = row.endpos();
        pos_type first = row.pos();
-       pos_type const par_size = par.size();
 
        // hfill *DO* count at the beginning of paragraphs!
        if (first) {
-               while (first < last && first < par_size && par.isHfill(first))
+               while (first < last && par.isHfill(first))
                        ++first;
        }
 
        first = max(first, par.beginOfBody());
-       last = min(last, par_size);
 
        int n = 0;
        for (pos_type p = first; p < last; ++p) {
@@ -260,6 +258,10 @@ bool TextMetrics::redoParagraph(pit_type const pit)
 
        par_metrics_[pit] = pm;
 
+       // Update the row change statuses. The painter will need that info
+       // in order to know which row has to be repainted.
+       par_metrics_[pit].updateRowChangeStatus();
+
        return changed;
 }