mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fine tune the math class of InsetMathScript after a4676712
This commit is contained in:
parent
516423c54e
commit
d9018f14a6
@ -276,13 +276,16 @@ int InsetMathScript::nker(BufferView const * bv) const
|
||||
MathClass InsetMathScript::mathClass() const
|
||||
{
|
||||
// FIXME: this is a hack, since the class will not be correct if
|
||||
// the nucleus has several elements.
|
||||
// the nucleus has several elements or if the last element is a math macro
|
||||
// or a macro argument proxy.
|
||||
// The correct implementation would require to linearize the nucleus.
|
||||
if (nuc().empty())
|
||||
return MC_ORD;
|
||||
else
|
||||
else {
|
||||
// return the class of last element since this is the one that counts.
|
||||
return nuc().back()->mathClass();
|
||||
MathClass mc = nuc().back()->mathClass();
|
||||
return (mc == MC_UNKNOWN) ? MC_ORD : mc;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user