]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.cpp
Use current_font, not real_current_font, in character dialog
[lyx.git] / src / TextMetrics.cpp
index e7bd6190e28759405821df6cda72e4d245ae5cfa..cacf2e7ea65326ff73312eebe12b97e01d4df631 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)
@@ -1573,7 +1573,7 @@ void TextMetrics::deleteLineForward(Cursor & cur)
                if (!cur.selection())
                        text_->deleteWordForward(cur);
                else
-                       cap::cutSelection(cur, true, false);
+                       cap::cutSelection(cur, false);
                cur.checkBufferStructure();
        }
 }
@@ -1618,10 +1618,10 @@ int TextMetrics::leftMargin(pit_type const pit, pos_type const pos) const
 
        int l_margin = 0;
 
-       if (text_->isMainText())
+       if (text_->isMainText()) {
                l_margin += bv_->leftMargin();
-
-       l_margin += bfm.signedWidth(tclass.leftmargin());
+               l_margin += bfm.signedWidth(tclass.leftmargin());
+       }
 
        int depth = par.getDepth();
        if (depth != 0) {
@@ -1891,8 +1891,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const
 
                // 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) {