]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Fix creationCode() of GuiPrintNomencl
[lyx.git] / src / TextMetrics.cpp
index 42637d78993d3065e35a48a1c88df98a908aff28..e5345dd0405c7cd775dfc0dbd5de582aa846c713 100644 (file)
@@ -1502,14 +1502,14 @@ int TextMetrics::cursorX(CursorSlice const & sl,
 int TextMetrics::cursorY(CursorSlice const & sl, bool boundary) const
 {
        //lyxerr << "TextMetrics::cursorY: boundary: " << boundary << endl;
-       ParagraphMetrics const & pm = par_metrics_[sl.pit()];
+       ParagraphMetrics const & pm = parMetrics(sl.pit());
        if (pm.rows().empty())
                return 0;
 
        int h = 0;
-       h -= par_metrics_[0].rows()[0].ascent();
+       h -= parMetrics(0).rows()[0].ascent();
        for (pit_type pit = 0; pit < sl.pit(); ++pit) {
-               h += par_metrics_[pit].height();
+               h += parMetrics(pit).height();
        }
        int pos = sl.pos();
        if (pos && boundary)
@@ -1884,15 +1884,14 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
                // whether this row is the first or last and update the margins.
                if (row.selection()) {
                        if (row.sel_beg == 0)
-                               row.begin_margin_sel = sel_beg.pit() < pit;
+                               row.change(row.begin_margin_sel, sel_beg.pit() < pit);
                        if (row.sel_end == sel_end_par.lastpos())
-                               row.end_margin_sel = sel_end.pit() > pit;
+                               row.change(row.end_margin_sel, sel_end.pit() > pit);
                }
 
                // has row changed since last paint?
                bool row_has_changed = row.changed()
-                       || bv_->hadHorizScrollOffset(text_, pit, row.pos())
-                       || bv_->needRepaint(text_, row);
+                       || bv_->hadHorizScrollOffset(text_, pit, row.pos());
 
                // Take this opportunity to spellcheck the row contents.
                if (row_has_changed && pi.do_spellcheck && lyxrc.spellcheck_continuously) {