commit 087f72202e9ee166d2ec5eedd12c9c7d48db416b
Author: Guillaume Munch <g...@lyx.org>
Date:   Mon Dec 12 01:51:45 2016 +0100

    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.
---
 src/mathed/MathMacro.cpp |   15 +++++++++++++++
 src/mathed/MathMacro.h   |    3 +++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp
index da22747..89f8200 100644
--- a/src/mathed/MathMacro.cpp
+++ b/src/mathed/MathMacro.cpp
@@ -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
diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h
index 5584dd7..6e79523 100644
--- a/src/mathed/MathMacro.h
+++ b/src/mathed/MathMacro.h
@@ -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;

Reply via email to