X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathBig.cpp;h=eeaf96514bd97fdd32d6c9d79585f9fc4e294785;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=9c2f3bff5b3f88ab7471bb1fde661fba115d248d;hpb=84050268ee98453ebe0a8fe8dc55fae2c91e7fd5;p=lyx.git diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp index 9c2f3bff5b..eeaf96514b 100644 --- a/src/mathed/InsetMathBig.cpp +++ b/src/mathed/InsetMathBig.cpp @@ -69,6 +69,7 @@ double InsetMathBig::increase() const void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const { + Changer dummy = mi.base.changeEnsureMath(); double const h = theFontMetrics(mi.base.font).ascent('I'); double const f = increase(); dim.wid = 6; @@ -77,18 +78,26 @@ void InsetMathBig::metrics(MetricsInfo & mi, Dimension & dim) const } -void InsetMathBig::draw(PainterInfo & pi, int x, int y) const +docstring InsetMathBig::word() const { - Dimension const dim = dimension(*pi.base.bv); // mathed_draw_deco does not use the leading backslash, so remove it // (but don't use ltrim if this is the backslash delimiter). // Replace \| by \Vert (equivalent in LaTeX), since mathed_draw_deco // would treat it as |. - docstring const delim = (delim_ == "\\|") ? from_ascii("Vert") : - (delim_ == "\\\\") ? from_ascii("\\") : support::ltrim(delim_, "\\"); + if (delim_ == "\\|") + return from_ascii("Vert"); + if (delim_ == "\\\\") + return from_ascii("\\"); + return support::ltrim(delim_, "\\"); +} + + +void InsetMathBig::draw(PainterInfo & pi, int x, int y) const +{ + Changer dummy = pi.base.changeEnsureMath(); + Dimension const dim = dimension(*pi.base.bv); mathed_draw_deco(pi, x + 1, y - dim.ascent(), 4, dim.height(), - delim); - setPosCache(pi, x, y); + word()); } @@ -145,6 +154,7 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim) "<", ">", "\\\\", "\\backslash", "\\langle", "\\lceil", "\\lfloor", "\\rangle", "\\rceil", "\\rfloor", + "\\llbracket", "\\rrbracket", "\\downarrow", "\\Downarrow", "\\uparrow", "\\Uparrow", "\\updownarrow", "\\Updownarrow", "" @@ -155,6 +165,7 @@ bool InsetMathBig::isBigInsetDelim(docstring const & delim) void InsetMathBig::validate(LaTeXFeatures & features) const { + validate_math_word(features, word()); if (features.runparams().math_flavor == OutputParams::MathAsHTML) features.addCSSSnippet( "span.bigsymbol{font-size: 150%;}\n"