X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetScript.cpp;h=f87f6c474765f4a6b6888b442f8580cb69f4dbc8;hb=62af7ee772f16f154225d2d0b65d77f4376b6001;hp=8057962d9bfee7b5b1167645e843e68010b942f1;hpb=b28ec44476d3f2c5858d06596ed5bd975012ec33;p=lyx.git diff --git a/src/insets/InsetScript.cpp b/src/insets/InsetScript.cpp index 8057962d9b..f87f6c4747 100644 --- a/src/insets/InsetScript.cpp +++ b/src/insets/InsetScript.cpp @@ -151,9 +151,17 @@ docstring InsetScript::layoutName() const } +Inset::DisplayType InsetScript::display() const +{ + return Inline; +} + + void InsetScript::metrics(MetricsInfo & mi, Dimension & dim) const { int const shift = params_.shift(mi.base.font); + // Remember the value of the outser font, so that it can be used in cursorPos. + outer_font_ = mi.base.font; Changer dummy = mi.base.changeScript(); InsetText::metrics(mi, dim); dim.asc -= shift; @@ -172,8 +180,7 @@ void InsetScript::draw(PainterInfo & pi, int x, int y) const void InsetScript::cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const { - Font const font = bv.textMetrics(&text()).displayFont(sl.pit(), sl.pos()); - int const shift = params_.shift(font.fontInfo()); + int const shift = params_.shift(outer_font_); InsetText::cursorPos(bv, sl, boundary, x, y); y += shift; } @@ -274,6 +281,7 @@ bool InsetScript::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_PREVIEW_INSERT: case LFUN_QUOTE_INSERT: case LFUN_TABULAR_INSERT: + case LFUN_TABULAR_STYLE_INSERT: case LFUN_WRAP_INSERT: flag.setEnabled(false); return true;