X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursor.cpp;h=e2d1f893ae120d986073905fe3ef217c38b02192;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=6f393e3799b7242f0b8c41e48195dc4ec639e80e;hpb=3bc80220a79dc7e02f90fa035b2afc102f9d531f;p=lyx.git diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 6f393e3799..e2d1f893ae 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -15,6 +15,7 @@ #include #include "Buffer.h" +#include "BufferParams.h" #include "BufferView.h" #include "CoordCache.h" #include "Cursor.h" @@ -2066,10 +2067,14 @@ Encoding const * Cursor::getEncoding() const { if (empty()) return 0; + BufferParams const & bp = bv().buffer().params(); + if (bp.useNonTeXFonts) + return encodings.fromLyXName("utf8-plain"); + CursorSlice const & sl = innerTextSlice(); Text const & text = *sl.text(); - Font font = text.getPar(sl.pit()).getFont( - bv().buffer().params(), sl.pos(), text.outerFont(sl.pit())); + Font font = text.getPar(sl.pit()).getFont(bp, sl.pos(), + text.outerFont(sl.pit())); return font.language()->encoding(); } @@ -2121,6 +2126,7 @@ Font Cursor::getFont() const // The logic here should more or less match to the // Cursor::setCurrentFont logic, i.e. the cursor height should // give a hint what will happen if a character is entered. + // FIXME: this is not the case, what about removing this method ? (see #10478). // HACK. far from being perfect...