X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FTextMetrics.cpp;h=f78594f54dad9860e42a6f2f05aedc13224edb32;hb=bb80bd78f981c888efcc030168bd4e366b0ca6cd;hp=fe7a928e144ab3857f5df95bdc6680faefb7417c;hpb=08feb0e14cd9733d1d921344f1dc67e04a2bebb0;p=lyx.git diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index fe7a928e14..f78594f54d 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -244,11 +244,9 @@ int TextMetrics::rightMargin(pit_type const pit) const void TextMetrics::applyOuterFont(Font & font) const { - Font lf(font_); - lf.fontInfo().reduce(bv_->buffer().params().getFont().fontInfo()); - lf.fontInfo().realize(font.fontInfo()); - lf.setLanguage(font.language()); - font = lf; + FontInfo lf(font_.fontInfo()); + lf.reduce(bv_->buffer().params().getFont().fontInfo()); + font.fontInfo().realize(lf); } @@ -1495,8 +1493,8 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y, int yy = y; // is modified by getPitAndRowNearY Row const & row = getPitAndRowNearY(yy, pit, assert_in_view, up); - bool bound = false; + bool bound = false; // is modified by getColumnNearX int xx = x; // is modified by getColumnNearX pos_type const pos = row.pos() + getColumnNearX(pit, row, xx, bound); @@ -1518,17 +1516,16 @@ Inset * TextMetrics::editXY(Cursor & cur, int x, int y, } ParagraphList const & pars = text_->paragraphs(); - Inset const * insetBefore = pos ? pars[pit].getInset(pos - 1) : 0; - //Inset * insetBehind = pars[pit].getInset(pos); + Inset const * inset_before = pos ? pars[pit].getInset(pos - 1) : 0; // This should be just before or just behind the // cursor position set above. - LASSERT((pos != 0 && inset == insetBefore) + LASSERT(inset == inset_before || inset == pars[pit].getInset(pos), /**/); // Make sure the cursor points to the position before // this inset. - if (inset == insetBefore) { + if (inset == inset_before) { --cur.pos(); cur.boundary(false); }