void InsetMathScript::metrics(MetricsInfo & mi, Dimension & dim) const
{
// we store this, because it is much easier
- has_limits_ = hasLimits(mi.base.font);
+ has_limits_ = hasLimits(mi.base.font.style());
// Compute metrics of the available cells
Dimension dim0;
}
-bool InsetMathScript::hasLimits(FontInfo const & font) const
+bool InsetMathScript::hasLimits(MathStyle const & style) const
{
if (nuc().empty())
return false;
Limits const lim = nuc().back()->limits() == AUTO_LIMITS
- ? nuc().back()->defaultLimits(font.style() == DISPLAY_STYLE)
+ ? nuc().back()->defaultLimits(style == DISPLAY_STYLE)
: nuc().back()->limits();
LASSERT(lim != AUTO_LIMITS, return false);
return lim == LIMITS;
}
-bool InsetMathScript::hasLimits(MathStyle const & style) const
-{
- FontInfo font = sane_font;
- font.setStyle(style);
- return hasLimits(font);
-}
-
-
void InsetMathScript::removeScript(bool up)
{
if (nargs() == 2) {
if (!d && !u)
return;
- const char * tag;
+ const char * tag = nullptr;
if (u && d)
tag = has_limits ? "munderover" : "msubsup";
else if (u)
if (!nuc().empty())
ms << nuc();
else
+ // TODO: is this empty <mrow> required?
ms << CTag("mrow");
+ // No need to wrap these in an <mrow>, as it's done by MathExtern.
+ // More details in https://www.lyx.org/trac/ticket/12221#comment:10.
if (d)
- ms << MTag("mrow") << down() << ETag("mrow");
+ ms << down();
if (u)
- ms << MTag("mrow") << up() << ETag("mrow");
+ ms << up();
ms << ETag(tag);
}