Use math class information from lib/symbols for intelligent splitting

This was missing for macros defined in lib/symbols. This only affects the
equation splitting since global macros are always linearized. This fixes #10107.
This commit is contained in:
Guillaume Munch 2016-12-12 01:51:45 +01:00
parent 3e79e0f5f0
commit 087f72202e
2 changed files with 18 additions and 0 deletions

View File

@ -821,6 +821,21 @@ size_t MathMacro::appetite() const
}
MathClass MathMacro::mathClass() const
{
// this only affects intelligent splitting since global macros are always
// linearised.
if (MacroData const * m = macroBackup()) {
if (m->symbol()) {
MathClass mc = string_to_class(d->macroBackup_.symbol()->extra);
if (mc != MC_UNKNOWN)
return mc;
}
}
return MC_ORD;
}
InsetMath::mode_type MathMacro::currentMode() const
{
// There is no way to guess the mode of user defined macros, so they are

View File

@ -141,6 +141,9 @@ public:
size_t appetite() const;
///
InsetCode lyxCode() const { return MATH_MACRO_CODE; }
/// This is not used for display; however whether it is mathrel determines
/// how to split equations intelligently.
MathClass mathClass() const; //override
protected:
friend class MathData;