commit f5e607185905a9b2f43522080d6ada5e2cfefa8c
Author: Koji Yokota <[email protected]>
Date:   Sun Jun 22 19:53:01 2025 +0900

    Set up a math-text toolbar menu
    
    intertext and shortintertext are forced to be used in only compatible
    math hulls (inputs via key commands are also controled)
---
 lib/Makefile.am                         |  14 +++++++--
 lib/images/math/dynamic-math-texts.svgz | Bin 0 -> 790 bytes
 lib/images/math/fbox.svgz               | Bin 0 -> 1418 bytes
 lib/images/math/framebox.svgz           | Bin 0 -> 1545 bytes
 lib/images/math/intertext.svgz          | Bin 0 -> 1000 bytes
 lib/images/math/mbox.svgz               | Bin 0 -> 1077 bytes
 lib/images/math/shortintertext.svgz     | Bin 0 -> 995 bytes
 lib/images/math/text.svgz               | Bin 0 -> 1077 bytes
 lib/images/math/textnormal.svgz         | Bin 0 -> 1077 bytes
 lib/math_conflicts                      |  27 +++++++++++++++++
 lib/ui/stdtoolbars.inc                  |   4 +--
 src/Cursor.cpp                          |  14 +++++++--
 src/frontends/qt/GuiToolbar.cpp         |  24 +++++++++++++++
 src/frontends/qt/GuiToolbar.h           |  22 ++++++++++++++
 src/insets/Inset.cpp                    |   1 +
 src/insets/InsetCode.h                  |  24 ++++++++-------
 src/insets/InsetText.cpp                |  14 +++++++++
 src/mathed/InsetMathGrid.cpp            |   3 ++
 src/mathed/InsetMathGrid.h              |   2 ++
 src/mathed/InsetMathHull.cpp            |  27 +++++++++++++++++
 src/mathed/InsetMathHull.h              |   2 +-
 src/mathed/InsetMathIntertext.cpp       |   5 ++++
 src/mathed/MathFactory.cpp              |  50 ++++++++++++++++++++++++++++++++
 src/mathed/MathFactory.h                |   7 +++++
 24 files changed, 222 insertions(+), 18 deletions(-)

diff --git a/lib/Makefile.am b/lib/Makefile.am
index f45847b737..5adbf3428c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -7,8 +7,9 @@ CHMOD = chmod
 EXTRA_DIST = examples/CMakeLists.txt scripts/CMakeLists.txt 
examples/README.new_examples
 
 dist_pkgdata_DATA = CREDITS autocorrect chkconfig.ltx \
-       encodings layouttranslations languages latexcolors latexfonts 
RELEASE-NOTES \
-       symbols syntax.default unicode_alphanum_variants unicodesymbols
+       encodings layouttranslations languages latexcolors latexfonts \
+       math_conflicts RELEASE-NOTES symbols syntax.default \
+       unicode_alphanum_variants unicodesymbols
 
 # We use DATA now instead of PYTHON because automake 1.11.2 complains.
 # Note that we "chmod 755" manually this file in install-data-hook.
@@ -976,6 +977,7 @@ dist_imagesmath_DATA = \
        images/math/downdownarrows.svgz \
        images/math/downharpoonleft.svgz \
        images/math/downharpoonright.svgz \
+       images/math/dynamic-math-texts.svgz \
        images/math/earth.svgz \
        images/math/eighthnote.svgz \
        images/math/ell.svgz \
@@ -1000,6 +1002,7 @@ dist_imagesmath_DATA = \
        images/math/fatbslash.svgz \
        images/math/fatsemi.svgz \
        images/math/fatslash.svgz \
+       images/math/fbox.svgz \
        images/math/female.svgz \
        images/math/fint.svgz \
        images/math/fintop.svgz \
@@ -1009,6 +1012,7 @@ dist_imagesmath_DATA = \
        images/math/forall.svgz \
        images/math/frac.svgz \
        images/math/frac-square.svgz \
+       images/math/framebox.svgz \
        images/math/frown.svgz \
        images/math/frownie.svgz \
        images/math/fullmoon.svgz \
@@ -1070,6 +1074,7 @@ dist_imagesmath_DATA = \
        images/math/int.svgz \
        images/math/intercal.svgz \
        images/math/interleave.svgz \
+       images/math/intertext.svgz \
        images/math/intop.svgz \
        images/math/iota.svgz \
        images/math/invdiameter.svgz \
@@ -1220,6 +1225,7 @@ dist_imagesmath_DATA = \
        images/math/mathsf.svgz \
        images/math/mathtt.svgz \
        images/math/matrix.svgz \
+       images/math/mbox.svgz \
        images/math/measuredangle.svgz \
        images/math/mercury.svgz \
        images/math/merge.svgz \
@@ -1400,6 +1406,7 @@ dist_imagesmath_DATA = \
        images/math/setminus.svgz \
        images/math/sharp.svgz \
        images/math/shortdownarrow.svgz \
+       images/math/shortintertext.svgz \
        images/math/shortleftarrow.svgz \
        images/math/shortmid.svgz \
        images/math/shortparallel.svgz \
@@ -1480,11 +1487,14 @@ dist_imagesmath_DATA = \
        images/math/talloblong.svgz \
        images/math/tau.svgz \
        images/math/taurus.svgz \
+       images/math/text.svgz \
+       images/math/textnormal.svgz \
        images/math/textrm_AA.svgz \
        images/math/textrm_O.svgz \
        images/math/therefore.svgz \
        images/math/theta.svgz \
        images/math/theta2.svgz \
+       images/math/text.svgz \
        images/math/textdegree.svgz \
        images/math/textrm.svgz \
        images/math/thickapprox.svgz \
diff --git a/lib/images/math/dynamic-math-texts.svgz 
b/lib/images/math/dynamic-math-texts.svgz
new file mode 100644
index 0000000000..3ee7d50cb5
Binary files /dev/null and b/lib/images/math/dynamic-math-texts.svgz differ
diff --git a/lib/images/math/fbox.svgz b/lib/images/math/fbox.svgz
new file mode 100644
index 0000000000..a08901d34c
Binary files /dev/null and b/lib/images/math/fbox.svgz differ
diff --git a/lib/images/math/framebox.svgz b/lib/images/math/framebox.svgz
new file mode 100644
index 0000000000..f872bab175
Binary files /dev/null and b/lib/images/math/framebox.svgz differ
diff --git a/lib/images/math/intertext.svgz b/lib/images/math/intertext.svgz
new file mode 100644
index 0000000000..b750bf25dc
Binary files /dev/null and b/lib/images/math/intertext.svgz differ
diff --git a/lib/images/math/mbox.svgz b/lib/images/math/mbox.svgz
new file mode 100644
index 0000000000..1c7b4e2934
Binary files /dev/null and b/lib/images/math/mbox.svgz differ
diff --git a/lib/images/math/shortintertext.svgz 
b/lib/images/math/shortintertext.svgz
new file mode 100644
index 0000000000..be2c2eb5ec
Binary files /dev/null and b/lib/images/math/shortintertext.svgz differ
diff --git a/lib/images/math/text.svgz b/lib/images/math/text.svgz
new file mode 100644
index 0000000000..1c7b4e2934
Binary files /dev/null and b/lib/images/math/text.svgz differ
diff --git a/lib/images/math/textnormal.svgz b/lib/images/math/textnormal.svgz
new file mode 100644
index 0000000000..1c7b4e2934
Binary files /dev/null and b/lib/images/math/textnormal.svgz differ
diff --git a/lib/math_conflicts b/lib/math_conflicts
new file mode 100644
index 0000000000..af13a44969
--- /dev/null
+++ b/lib/math_conflicts
@@ -0,0 +1,27 @@
+#
+# List of incompatible commands and math environments
+#
+# The incompatible command names should be listed one by one delimited by a
+# carriage return under the headings of the math environment name surrounded by
+# brackets
+#
+# Rules are also applied to those environments that have a trailing star
+# to their names
+
+# Inline equation $...$
+[simple]
+intertext
+shortintertext
+
+# Display equation \[...\]
+[equation]
+intertext
+shortintertext
+
+[eqnarray]
+intertext
+shortintertext
+
+[multline]
+intertext
+shortintertext
diff --git a/lib/ui/stdtoolbars.inc b/lib/ui/stdtoolbars.inc
index bdd498ce43..ecee7fcbd5 100644
--- a/lib/ui/stdtoolbars.inc
+++ b/lib/ui/stdtoolbars.inc
@@ -219,8 +219,9 @@ ToolbarSet
                PopupMenu "space" "Math spacings"
                PopupMenu "style" "Styles & classes"
                PopupMenu "frac-square" "Fractions"
-               PopupMenu "font" "Fonts"
                PopupMenu "functions" "Functions"
+               PopupMenu "font" "Fonts"
+               DynamicMenu "dynamic-math-texts" "Text"
                IconPalette "latex_deco" "Frame decorations"
                IconPalette "latex_varsz" "Big operators"
                IconPalette "latex_misc" "Miscellaneous"
@@ -454,7 +455,6 @@ ToolbarSet
                Item "Fraktur   \\mathfrak" "math-insert \mathfrak"
                Item "Calligraphic      \\mathcal" "math-insert \mathcal"
                Item "Formal Script     \\mathscr" "math-insert \mathscr"
-               Item "Normal text mode  \\textrm" "math-insert \textrm"
        End
 
        Toolbar "latex_dots" "Dots"
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index f190cf0027..daa9e562bb 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -32,6 +32,7 @@
 #include "Text.h"
 #include "TextMetrics.h"
 #include "TocBackend.h"
+#include "FuncStatus.h"
 
 #include "support/debug.h"
 #include "support/docstream.h"
@@ -1786,8 +1787,17 @@ bool Cursor::macroModeClose(bool cancel)
        if (in && in->interpretString(*this, s))
                return true;
        bool const user_macro = buffer()->getMacro(name, *this, false);
-       MathAtom atom = user_macro ? MathAtom(new InsetMathMacro(buffer(), 
name))
-                                  : createInsetMath(name, buffer());
+
+       MathAtom atom;
+       FuncRequest fr(LFUN_MATH_INSERT, "\\" + name);
+       FuncStatus status;
+       getStatus(fr, status);
+       // exit if the inset cannot be used e.g. in the current math hull
+       if (!status.enabled())
+               return false;
+       else
+               atom = user_macro ? MathAtom(new InsetMathMacro(buffer(), name))
+                                          : createInsetMath(name, buffer());
 
        // try to put argument into macro, if we just inserted a macro
        bool macroArg = false;
diff --git a/src/frontends/qt/GuiToolbar.cpp b/src/frontends/qt/GuiToolbar.cpp
index fddd49f48e..f726dd7a5b 100644
--- a/src/frontends/qt/GuiToolbar.cpp
+++ b/src/frontends/qt/GuiToolbar.cpp
@@ -372,6 +372,7 @@ bool DynamicMenuButton::isMenuType(string const & s)
 {
        return s == "dynamic-custom-insets"
                || s == "dynamic-char-styles"
+               || s == "dynamic-math-texts"
                || s == "textstyle-apply"
                || s == "paste";
 }
@@ -422,6 +423,8 @@ void DynamicMenuButton::updateTriggered()
                setEnabled(!bv->buffer().isReadonly()
                           && !m->isEmpty()
                           && inset->insetAllowed(FLEX_CODE));
+       } else if (menutype == "dynamic-math-texts") {
+               setEnabled(loadMathTexts());
        } else if (menutype == "textstyle-apply") {
                m->clear();
                setPopupMode(QToolButton::MenuButtonPopup);
@@ -527,6 +530,27 @@ void DynamicMenuButton::loadFlexInsets()
 }
 
 
+bool DynamicMenuButton::loadMathTexts()
+{
+       QMenu * m = menu();
+       m->clear();
+       bool isEnabled = false;
+
+       for (int i=0; i<mathTextMenuSize_; i++) {
+               FuncRequest func(LFUN_MATH_INSERT, "\\" + mathTextMenu[i][0],
+                                FuncRequest::TOOLBAR);
+               QString menuText = toqstr(from_utf8(mathTextMenu[i][1] + "\t\\" 
+
+                                                   mathTextMenu[i][0]));
+               QString tooltip = toqstr(from_utf8(mathTextMenu[i][2]));
+               Action * act =
+                       new Action(func, getIcon(func, false), menuText, 
tooltip, this);
+               m->addAction(act);
+               isEnabled |= lyx::getStatus(func).enabled();
+       }
+       return isEnabled;
+}
+
+
 void GuiToolbar::add(ToolbarItem const & item)
 {
        switch (item.type) {
diff --git a/src/frontends/qt/GuiToolbar.h b/src/frontends/qt/GuiToolbar.h
index 6ec61acb48..2323a6b4da 100644
--- a/src/frontends/qt/GuiToolbar.h
+++ b/src/frontends/qt/GuiToolbar.h
@@ -16,6 +16,8 @@
 #ifndef GUITOOLBAR_H
 #define GUITOOLBAR_H
 
+#include "mathed/InsetMathHull.h"
+
 #include <QList>
 #include <QToolBar>
 #include <QToolButton>
@@ -101,6 +103,8 @@ protected:
        void initialize() override;
        ///
        void loadFlexInsets();
+       ///
+       bool loadMathTexts();
        /// pimpl so we don't have to include big files
        class Private;
        Private * d;
@@ -113,6 +117,24 @@ private:
        static QIcon icon_textstyle_apply_;
        static QIcon icon_undo_;
        static QIcon icon_paste_;
+
+       /// Size of the menu items of math texts
+       // Make this number sync with the row number of mathTextMenu
+       int const mathTextMenuSize_ = 8;
+       /// Dynamic menu items of math texts
+       // As of June 2025, only applicable to "Text" toolbar menu
+       std::string mathTextMenu[8][3] =
+       {
+               {"mbox",           "LR Text",          "Text in current font 
with constant sizes"},
+               {"fbox",           "Framed Text",      "Framed text"},
+               {"framebox",       "Framed Text with sizes", "Framed text with 
variable frame sizes"},
+               {"text",           "AMS Text",         "Text in current font 
with variable sizes"},
+               {"textrm",         "Roman Text",       "Text in roman font"},
+               {"textnormal",     "Normal Font Text", "Text using 
\\normalfont"},
+               {"intertext",      "Intertext",        "Text between 
equations"},
+               {"shortintertext", "Short Intertext",  "Text between equations 
of short height"}
+       };
+
 };
 
 
diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp
index 8884906b8e..3e9de261da 100644
--- a/src/insets/Inset.cpp
+++ b/src/insets/Inset.cpp
@@ -161,6 +161,7 @@ static void build_translator()
        insetnames[MATH_REF_CODE] = InsetName("mathref");
        insetnames[MATH_ROOT_CODE] = InsetName("mathroot");
        insetnames[MATH_SCRIPT_CODE] = InsetName("mathscript");
+       insetnames[MATH_SHORTINTERTEXT_CODE] = InsetName("mathshortintertext");
        insetnames[MATH_SIZE_CODE] = InsetName("mathsize");
        insetnames[MATH_SPACE_CODE] = InsetName("mathspace", _("Horizontal Math 
Space"));
        insetnames[MATH_SPECIALCHAR_CODE] = InsetName("mathspecialchar");
diff --git a/src/insets/InsetCode.h b/src/insets/InsetCode.h
index e7d113ef1a..a375500f60 100644
--- a/src/insets/InsetCode.h
+++ b/src/insets/InsetCode.h
@@ -193,13 +193,15 @@ enum InsetCode {
        ///
        MATH_SCRIPT_CODE,
        ///
+       MATH_SHORTINTERTEXT_CODE,
+       ///
        MATH_SIZE_CODE,
        ///
        MATH_SPACE_CODE,
        ///
-       MATH_SPECIALCHAR_CODE,
+       MATH_SPECIALCHAR_CODE, // 90
        ///
-       MATH_SPLIT_CODE, // 90
+       MATH_SPLIT_CODE,
        ///
        MATH_SQRT_CODE,
        ///
@@ -207,9 +209,9 @@ enum InsetCode {
        ///
        MATH_STRING_CODE,
        ///
-       MATH_SUBSTACK_CODE,
+       MATH_SUBSTACK_CODE, // 95
        ///
-       MATH_SYMBOL_CODE, // 95
+       MATH_SYMBOL_CODE,
        ///
        MATH_TABULAR_CODE,
        ///
@@ -217,9 +219,9 @@ enum InsetCode {
        ///
        MATH_UNDERSET_CODE,
        ///
-       MATH_UNKNOWN_CODE,
+       MATH_UNKNOWN_CODE, // 100
        ///
-       MATH_XARROW_CODE, // 100
+       MATH_XARROW_CODE,
        ///
        MATH_XYMATRIX_CODE,
        ///
@@ -227,9 +229,9 @@ enum InsetCode {
        ///
        ARGUMENT_PROXY_CODE,
        ///
-       PREVIEW_CODE,
+       PREVIEW_CODE, // 105
        ///
-       MATH_DIAGRAM_CODE, // 105
+       MATH_DIAGRAM_CODE,
        ///
        SCRIPT_CODE,
        ///
@@ -237,9 +239,9 @@ enum InsetCode {
        ///
        IPACHAR_CODE,
        ///
-       IPADECO_CODE,
+       IPADECO_CODE, // 110
        ///
-       MATH_CLASS_CODE, // 110
+       MATH_CLASS_CODE,
        ///
        COUNTER_CODE,
        ///
@@ -247,7 +249,7 @@ enum InsetCode {
        ///
        INDEXMACRO_SORTKEY_CODE,
        ///
-       INSET_CODE_SIZE
+       INSET_CODE_SIZE // 115
 };
 
 } // namespace lyx
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index bbcb1be721..a914bbf1bd 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -417,6 +417,17 @@ bool InsetText::getStatus(Cursor & cur, FuncRequest const 
& cmd,
                return true;
        }
 
+       // The below can be called when the math panel is on in the text mode
+       case LFUN_MATH_INSERT:
+               if (!cmd.argument().empty()) {
+                       status.setEnabled(
+                                   insetAllowed(
+                                       insetCode(
+                                           to_utf8("math" + 
ltrim(cmd.argument(), "\\")))));
+                       return true;
+               }
+               // let else go down to default
+
        default:
                // Dispatch only to text_ if the cursor is inside
                // the text_. It is not for context menus (bug 5797).
@@ -1059,6 +1070,9 @@ bool InsetText::insetAllowed(InsetCode code) const
        // These are only allowed in index insets
        case INDEXMACRO_CODE:
        case INDEXMACRO_SORTKEY_CODE:
+       // The below cannot be called from the text mode directly
+       case MATH_INTERTEXT_CODE:
+       case MATH_SHORTINTERTEXT_CODE:
                return false;
        default:
                return !isPassThru();
diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 1786d1b9de..02f0aac654 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -27,9 +27,12 @@
 #include "CutAndPaste.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
+#include "InsetMathIntertext.h"
 #include "LaTeXFeatures.h"
+#include "MathFactory.h"
 #include "TexRow.h"
 
+#include "frontends/alert.h"
 #include "frontends/Clipboard.h"
 #include "frontends/Painter.h"
 
diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h
index ae95eaf095..57f0cc1bed 100644
--- a/src/mathed/InsetMathGrid.h
+++ b/src/mathed/InsetMathGrid.h
@@ -287,6 +287,8 @@ private:
        char v_align_; // FIXME: add approp. type
        ///
        Inset * clone() const override;
+       ///
+       void checkMathCommandConflict(idx_type idx) const;
 };
 
 
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 6cd30c42d3..57ef566c56 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -47,6 +47,7 @@
 
 #include "Session.h"
 
+#include "insets/Inset.h"
 #include "insets/InsetLabel.h"
 #include "insets/InsetRef.h"
 #include "insets/RenderPreview.h"
@@ -908,6 +909,22 @@ bool InsetMathHull::notifyCursorLeaves(Cursor const & old, 
Cursor & cur)
 }
 
 
+bool InsetMathHull::insetAllowed(InsetCode code) const
+{
+       switch (code) {
+       case MATH_INTERTEXT_CODE:
+       case MATH_SHORTINTERTEXT_CODE:
+               for (HullType const & env : mathedConflictEnvs()) {
+                       if (getType() == env)
+                               return false;
+               }
+               return true;
+       default:
+               return !isPassThru();
+       }
+}
+
+
 docstring InsetMathHull::label(row_type row) const
 {
        LASSERT(row < nrows(), return docstring());
@@ -2227,6 +2244,16 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest 
const & cmd,
                return InsetMathGrid::getStatus(cur, cmd, status);
        }
 
+       case LFUN_MATH_INSERT:
+               if (!cmd.argument().empty()) {
+                       status.setEnabled(
+                                   insetAllowed(
+                                       insetCode(
+                                           to_utf8("math" + 
ltrim(cmd.argument(), "\\")))));
+                       return true;
+               } else
+                       return InsetMathGrid::getStatus(cur, cmd, status);
+
        default:
                return InsetMathGrid::getStatus(cur, cmd, status);
        }
diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h
index 8d79861d53..88b20fdbae 100644
--- a/src/mathed/InsetMathHull.h
+++ b/src/mathed/InsetMathHull.h
@@ -160,7 +160,7 @@ public:
        /// get notification when the cursor leaves this inset
        bool notifyCursorLeaves(Cursor const & old, Cursor & cur) override;
        ///
-       //bool insetAllowed(InsetCode code) const override;
+       bool insetAllowed(InsetCode code) const override;
        ///
        void addPreview(DocIterator const & inset_pos,
                graphics::PreviewLoader &) const override;
diff --git a/src/mathed/InsetMathIntertext.cpp 
b/src/mathed/InsetMathIntertext.cpp
index c9109279e3..f38a91d519 100644
--- a/src/mathed/InsetMathIntertext.cpp
+++ b/src/mathed/InsetMathIntertext.cpp
@@ -12,10 +12,15 @@
 
 #include "InsetMathIntertext.h"
 
+#include "Buffer.h"
+#include "BufferView.h"
+#include "Cursor.h"
 #include "Dimension.h"
 #include "LaTeXFeatures.h"
 #include "MathData.h"
+#include "MathFactory.h"
 #include "MathStream.h"
+#include "MathSupport.h"
 #include "MetricsInfo.h"
 #include "support/docstream.h"
 #include "support/lstrings.h"
diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp
index f39bef3d96..65678ba5fc 100644
--- a/src/mathed/MathFactory.cpp
+++ b/src/mathed/MathFactory.cpp
@@ -88,6 +88,8 @@ namespace {
 
 MathWordList theMathWordList;
 MathVariantList theMathVariantList;
+MathConflictList theMathConflictList;
+std::vector<HullType> theMathConflictEnvs;
 
 
 bool isMathFontAvailable(string & name)
@@ -425,6 +427,35 @@ void initVariantSymbols()
 }
 
 
+void initConflictList() {
+       FileName const filename = libFileSearch(string(), "math_conflicts");
+       LYXERR(Debug::MATHED, "read conflict list from " << filename);
+       if (filename.empty()) {
+               lyxerr << "Could not find conflict list file" << endl;
+               return;
+       }
+
+       ifstream fs(filename.toFilesystemEncoding().c_str());
+       // limit the size of strings we read to avoid memory problems
+       fs >> setw(65636);
+       string line;
+
+       HullType currentMathHull;
+       while (getline(fs, line)) {
+
+               if (line.empty() || line[0] == '#')
+                       continue;
+
+               if (line[0] == '[') {
+                       currentMathHull = hullType(from_utf8(trim(line, "[]")));
+                       theMathConflictEnvs.push_back(currentMathHull);
+               } else {
+                       
theMathConflictList[currentMathHull].push_back(from_utf8(line));
+               }
+       }
+}
+
+
 bool isSpecialChar(docstring const & name)
 {
        if (name.size() != 1)
@@ -451,6 +482,24 @@ MathVariantList const & mathedVariantList()
 }
 
 
+MathConflictList const & mathedConflictList()
+{
+       return theMathConflictList;
+}
+
+
+std::vector<docstring> const & mathedConflictList(HullType hull)
+{
+       return theMathConflictList[hull];
+}
+
+
+std::vector<HullType> const & mathedConflictEnvs()
+{
+       return theMathConflictEnvs;
+}
+
+
 void initMath()
 {
        static bool initialized = false;
@@ -459,6 +508,7 @@ void initMath()
                initParser();
                initSymbols();
                initVariantSymbols();
+               initConflictList();
        }
 }
 
diff --git a/src/mathed/MathFactory.h b/src/mathed/MathFactory.h
index 02c4be1c58..0f06ff6e85 100644
--- a/src/mathed/MathFactory.h
+++ b/src/mathed/MathFactory.h
@@ -12,6 +12,7 @@
 #ifndef MATH_FACTORY_H
 #define MATH_FACTORY_H
 
+#include "InsetMath.h"
 #include "MathParser.h"
 
 #include <map>
@@ -37,6 +38,12 @@ MathWordList const & mathedWordList();
 typedef std::map<docstring, UnicodeVariants> MathVariantList;
 MathVariantList const & mathedVariantList();
 
+typedef std::map<HullType, std::vector<docstring>> MathConflictList;
+MathConflictList const & mathedConflictList();
+std::vector<docstring> const & mathedConflictList(HullType hull);
+
+std::vector<HullType> const & mathedConflictEnvs();
+
 } // namespace lyx
 
 #endif
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to