]> git.lyx.org Git - features.git/commitdiff
Give inset codes to all the math insets, so we get more information when
authorRichard Heck <rgheck@comcast.net>
Thu, 16 Jul 2009 19:00:24 +0000 (19:00 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 16 Jul 2009 19:00:24 +0000 (19:00 +0000)
we run into assertions.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30634 a592a061-630c-0410-9148-cb99ea01b6c8

62 files changed:
src/Text3.cpp
src/insets/Inset.cpp
src/insets/InsetCode.h
src/mathed/InsetFormulaMacro.h
src/mathed/InsetMath.h
src/mathed/InsetMathAMSArray.h
src/mathed/InsetMathArray.h
src/mathed/InsetMathBig.h
src/mathed/InsetMathBoldSymbol.h
src/mathed/InsetMathBox.h
src/mathed/InsetMathBrace.h
src/mathed/InsetMathCases.h
src/mathed/InsetMathChar.h
src/mathed/InsetMathColor.h
src/mathed/InsetMathComment.h
src/mathed/InsetMathDecoration.h
src/mathed/InsetMathDelim.h
src/mathed/InsetMathDiff.h
src/mathed/InsetMathDots.h
src/mathed/InsetMathEnsureMath.h
src/mathed/InsetMathEnv.h
src/mathed/InsetMathExFunc.h
src/mathed/InsetMathExInt.h
src/mathed/InsetMathFont.h
src/mathed/InsetMathFontOld.h
src/mathed/InsetMathFrac.h
src/mathed/InsetMathGrid.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathHull.h
src/mathed/InsetMathKern.h
src/mathed/InsetMathLefteqn.h
src/mathed/InsetMathLim.h
src/mathed/InsetMathMBox.h
src/mathed/InsetMathMatrix.h
src/mathed/InsetMathNest.h
src/mathed/InsetMathNumber.h
src/mathed/InsetMathOverset.h
src/mathed/InsetMathPar.h
src/mathed/InsetMathPhantom.h
src/mathed/InsetMathRef.h
src/mathed/InsetMathRoot.h
src/mathed/InsetMathScript.h
src/mathed/InsetMathSize.h
src/mathed/InsetMathSpace.h
src/mathed/InsetMathSpecialChar.h
src/mathed/InsetMathSplit.h
src/mathed/InsetMathSqrt.h
src/mathed/InsetMathStackrel.h
src/mathed/InsetMathString.h
src/mathed/InsetMathSubstack.h
src/mathed/InsetMathSymbol.h
src/mathed/InsetMathTabular.h
src/mathed/InsetMathUnderset.h
src/mathed/InsetMathUnknown.h
src/mathed/InsetMathXArrow.h
src/mathed/InsetMathXYArrow.h
src/mathed/InsetMathXYMatrix.h
src/mathed/MacroTable.cpp
src/mathed/MathMacro.h
src/mathed/MathMacroArgument.h
src/mathed/MathMacroTemplate.cpp
src/mathed/MathMacroTemplate.h

index 743538db40c35644aae0267552b01b088a9ffa71..a09573a644bfb56a5cdd84a7fd8fa082a0b61420 100644 (file)
@@ -2446,7 +2446,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
        case LFUN_MATH_MACRO:
        case LFUN_MATH_SUBSCRIPT:
        case LFUN_MATH_SUPERSCRIPT:
-               code = MATH_CODE;
+               code = MATH_HULL_CODE;
                break;
 
        case LFUN_INSET_MODIFY:
index a9c13b76e214d3150494f4e51536806da5f7e643..ef5c17856f4ac30e14537f6c6d7796040d0bc649 100644 (file)
@@ -101,12 +101,65 @@ static TranslatorMap const build_translator()
                InsetName("flex", FLEX_CODE),
                InsetName("space", SPACE_CODE),
                InsetName("vspace", VSPACE_CODE),
-               InsetName("mathmacroarg", MATHMACROARG_CODE),
+               InsetName("mathmacroarg", MATH_MACROARG_CODE),
                InsetName("listings", LISTINGS_CODE),
                InsetName("info", INFO_CODE),
                InsetName("collapsable", COLLAPSABLE_CODE),
                InsetName("newpage", NEWPAGE_CODE),
-               InsetName("tablecell", CELL_CODE)
+               InsetName("tablecell", CELL_CODE),
+               InsetName("mathamsarray", MATH_AMSARRAY_CODE),
+               InsetName("matharray", MATH_ARRAY_CODE),
+               InsetName("mathbig", MATH_BIG_CODE),
+               InsetName("mathboldsymbol", MATH_BOLDSYMBOL_CODE),
+               InsetName("mathbox", MATH_BOX_CODE),
+               InsetName("mathbrace", MATH_BRACE_CODE),
+               InsetName("mathcases", MATH_CASES_CODE),
+               InsetName("mathchar", MATH_CHAR_CODE),
+               InsetName("mathcolor", MATH_COLOR_CODE),
+               InsetName("mathcomment", MATH_COMMENT_CODE),
+               InsetName("mathdecoration", MATH_DECORATION_CODE),
+               InsetName("mathdelim", MATH_DELIM_CODE),
+               InsetName("mathdiff", MATH_DIFF_CODE),
+               InsetName("mathdots", MATH_DOTS_CODE),
+               InsetName("mathensuremath", MATH_ENSUREMATH_CODE),
+               InsetName("mathenv", MATH_ENV_CODE),
+               InsetName("mathexfunc", MATH_EXFUNC_CODE),
+               InsetName("mathexint", MATH_EXINT_CODE),
+               InsetName("mathfont", MATH_FONT_CODE),
+               InsetName("mathfontold", MATH_FONTOLD_CODE),
+               InsetName("mathfrac", MATH_FRAC_CODE),
+               InsetName("mathgrid", MATH_GRID_CODE),
+               InsetName("math", MATH_CODE),
+               InsetName("mathhull", MATH_HULL_CODE),
+               InsetName("mathkern", MATH_KERN_CODE),
+               InsetName("mathlefteqn", MATH_LEFTEQN_CODE),
+               InsetName("mathlim", MATH_LIM_CODE),
+               InsetName("mathmatrix", MATH_MATRIX_CODE),
+               InsetName("mathmbox", MATH_MBOX_CODE),
+               InsetName("mathnest", MATH_NEST_CODE),
+               InsetName("mathnumber", MATH_NUMBER_CODE),
+               InsetName("mathoverset", MATH_OVERSET_CODE),
+               InsetName("mathpar", MATH_PAR_CODE),
+               InsetName("mathphantom", MATH_PHANTOM_CODE),
+               InsetName("mathref", MATH_REF_CODE),
+               InsetName("mathroot", MATH_ROOT_CODE),
+               InsetName("mathscript", MATH_SCRIPT_CODE),
+               InsetName("mathsize", MATH_SIZE_CODE),
+               InsetName("mathspace", MATH_SPACE_CODE),
+               InsetName("mathspecialchar", MATH_SPECIALCHAR_CODE),
+               InsetName("mathsplit", MATH_SPLIT_CODE),
+               InsetName("mathsqrt", MATH_SQRT_CODE),
+               InsetName("mathstackrel", MATH_STACKREL_CODE),
+               InsetName("mathstring", MATH_STRING_CODE),
+               InsetName("mathsubstack", MATH_SUBSTACK_CODE),
+               InsetName("mathsymbol", MATH_SYMBOL_CODE),
+               InsetName("mathtabular", MATH_TABULAR_CODE),
+               InsetName("mathunderset", MATH_UNDERSET_CODE),
+               InsetName("mathunknown", MATH_UNKNOWN_CODE),
+               InsetName("mathxarrow", MATH_XARROW_CODE),
+               InsetName("mathxyarrow", MATH_XYARROW_CODE),
+               InsetName("mathxymatrix", MATH_XYMATRIX_CODE),
+               InsetName("mathmacro", MATH_MACRO_CODE),
        };
 
        size_t const insetnames_size =
@@ -132,7 +185,7 @@ Buffer & Inset::buffer()
 {
        if (!buffer_) {
                odocstringstream s;
-               lyxerr << "LyX Code: " << lyxCode() << " name: " << name() << std::endl;
+               lyxerr << "LyX Code: " << lyxCode() << " name: " << insetName(lyxCode()) << std::endl;
                s << "LyX Code: " << lyxCode() << " name: " << name();
                LASSERT(false, /**/);
                throw ExceptionMessage(BufferException, 
@@ -226,7 +279,7 @@ string insetName(InsetCode c)
 
 void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 {
-       LASSERT(cur.buffer() == buffer_, return);
+       LASSERT(cur.buffer() == &buffer(), return);
        cur.updateFlags(Update::Force | Update::FitCursor);
        cur.dispatched();
        doDispatch(cur, cmd);
index 38c07559b6116d11aeaefe26f7cf551f5d52e952..841ae0d0c7b23dc3f72ba9f000ea6cd2c2a7a6bf 100644 (file)
@@ -99,7 +99,7 @@ enum InsetCode {
        ///
        VSPACE_CODE,
        ///
-       MATHMACROARG_CODE, // 40
+       MATH_MACROARG_CODE, // 40
        ///
        NOMENCL_CODE,
        ///
@@ -114,6 +114,110 @@ enum InsetCode {
        COLLAPSABLE_CODE,
        ///
        PHANTOM_CODE,
+       ///
+       MATH_AMSARRAY_CODE,
+       ///
+       MATH_ARRAY_CODE,
+       ///
+       MATH_BIG_CODE, // 50
+       ///
+       MATH_BOLDSYMBOL_CODE,
+       ///
+       MATH_BOX_CODE,
+       ///
+       MATH_BRACE_CODE,
+       ///
+       MATH_CASES_CODE,
+       ///
+       MATH_CHAR_CODE, // 55
+       ///
+       MATH_COLOR_CODE,
+       ///
+       MATH_COMMENT_CODE,
+       ///
+       MATH_DECORATION_CODE,
+       ///
+       MATH_DELIM_CODE,
+       ///
+       MATH_DIFF_CODE, // 60
+       ///
+       MATH_DOTS_CODE,
+       ///
+       MATH_ENSUREMATH_CODE,
+       ///
+       MATH_ENV_CODE,
+       ///
+       MATH_EXFUNC_CODE,
+       ///
+       MATH_EXINT_CODE, // 65
+       ///
+       MATH_FONT_CODE,
+       ///
+       MATH_FONTOLD_CODE,
+       ///
+       MATH_FRAC_CODE,
+       ///
+       MATH_GRID_CODE,
+       ///
+       MATH_HULL_CODE, // 70
+       ///
+       MATH_KERN_CODE,
+       ///
+       MATH_LEFTEQN_CODE,
+       ///
+       MATH_LIM_CODE,
+       ///
+       MATH_MATRIX_CODE,
+       ///
+       MATH_MBOX_CODE, // 75
+       ///
+       MATH_NEST_CODE,
+       ///
+       MATH_NUMBER_CODE,
+       ///
+       MATH_OVERSET_CODE,
+       ///
+       MATH_PAR_CODE,
+       ///
+       MATH_PHANTOM_CODE, // 80
+       ///
+       MATH_REF_CODE,
+       ///
+       MATH_ROOT_CODE,
+       ///
+       MATH_SCRIPT_CODE,
+       ///
+       MATH_SIZE_CODE,
+       ///
+       MATH_SPACE_CODE, // 85
+       ///
+       MATH_SPECIALCHAR_CODE,
+       ///
+       MATH_SPLIT_CODE,
+       ///
+       MATH_SQRT_CODE,
+       ///
+       MATH_STACKREL_CODE,
+       ///
+       MATH_STRING_CODE,// 90
+       ///
+       MATH_SUBSTACK_CODE,
+       ///
+       MATH_SYMBOL_CODE,
+       ///
+       MATH_TABULAR_CODE,
+       ///
+       MATH_UNDERSET_CODE,
+       ///
+       MATH_UNKNOWN_CODE, // 95
+       ///
+       MATH_XARROW_CODE,
+       ///
+       MATH_XYARROW_CODE,
+       ///
+       MATH_XYMATRIX_CODE,
+       ///
+       MATH_MACRO_CODE,
 };
 
 } // namespace lyx
index 47dc2664d82c19b669a165acbd92a38f82075315..7d08dc3d754abbd7a2cf1d5bc7729afa57a96290 100644 (file)
@@ -51,11 +51,13 @@ public:
        int docbook(odocstream &, OutputParams const &) const;
 
        ///
-       InsetCode lyxCode() const { return MATHMACRO_CODE; }
+       InsetCode lyxCode() const { return MATHMACRO_CODE_CODE; }
        ///
        docstring const & getInsetName() const { return name_; }
        ///
        bool editable() const { return true; }
+       ///
+       InsetCode lyxCode() const { return MATH_FORMULA_MACRO_CODE; }
 private:
        ///
        MathAtom & tmpl() const;
index 8aef3591fa6657031a65487d500c4a0ef7893710..4bbf4a00a564b0909e0212e0523fe7e1754047c4 100644 (file)
@@ -205,6 +205,8 @@ public:
 
        /// superscript kerning
        virtual int kerning(BufferView const *) const { return 0; }
+       ///
+       InsetCode lyxCode() const { return MATH_CODE; }
 };
 
 ///
index 76c02f245297da64349562a9f4949f38080c9d73..9cf98a5cd7c7f1dcaad0e8a7a53c49ea0d19cdb9 100644 (file)
@@ -44,6 +44,8 @@ public:
        void normalize(NormalStream &) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_AMSARRAY_CODE; }
 private:
        virtual Inset * clone() const;
        ///
index 91c72b45abf48f546692f278bc38b008792f2dcf..8768b3ed0f96e358c0a9f501a313861592bd69e9 100644 (file)
@@ -49,6 +49,8 @@ public:
        void maple(MapleStream & os) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_ARRAY_CODE; }
 private:
        virtual Inset * clone() const;
        ///
index cb65d2f8e4f295f075be7896dbe9cf7435437bb7..58880dc867afcf1fffa9058233f56e9bee0eae03 100644 (file)
@@ -38,7 +38,8 @@ public:
        void infoize2(odocstream & os) const;
        ///
        static bool isBigInsetDelim(docstring const &);
-
+       ///
+       InsetCode lyxCode() const { return MATH_BIG_CODE; }
 private:
        virtual Inset * clone() const;
        ///
index d91de3816a0918b484c427a251af6ce40db78d83..67b0dfa4b7e08b7ced17ba85a91d55ba6d324a87 100644 (file)
@@ -45,6 +45,8 @@ public:
        ///
        void infoize(odocstream & os) const;
        ///
+       InsetCode lyxCode() const { return MATH_BOLDSYMBOL_CODE; }
+       ///
        Kind kind_;
 private:
        virtual Inset * clone() const;
index d5c269cfecc85a55587ebeda793cd644909416d9..5839439ed7e3a07bab54b39e16a372fda0a5ab99 100644 (file)
@@ -38,6 +38,8 @@ public:
        void infoize(odocstream & os) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_BOX_CODE; }
 
 private:
        Inset * clone() const { return new InsetMathBox(*this); }
index f93508cbfe35d3700a16ff7e05960a9cf859ecf4..4893db7c695a703fa8a336bbddbdc74bdb871f5d 100644 (file)
@@ -49,6 +49,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_BRACE_CODE; }
 private:
        virtual Inset * clone() const;
 };
index f518d065981653308e1b2c10bbfdf3ebeaf0fef7..9ceac475ea237b822bbbeb2cd5423525ca03f4eb 100644 (file)
@@ -46,6 +46,8 @@ public:
        void write(WriteStream & os) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_CASES_CODE; }
 private:
        virtual Inset * clone() const;
 };
index ccfe0b4978d03ac9bf636a52f454ffb3695e2f45..6dba328c4e3deac9c4aec64a589ad29c72840447 100644 (file)
@@ -48,6 +48,8 @@ public:
        char_type getChar() const { return char_; }
        ///
        bool isRelOp() const;
+       ///
+       InsetCode lyxCode() const { return MATH_CHAR_CODE; }
 
 private:
        virtual Inset * clone() const;
index fad0e658d1cb00447b2907443ea708cef6f974e2..19f1636b17b5bca4756dd9accb744f32ec89f434 100644 (file)
@@ -42,6 +42,8 @@ public:
        void normalize(NormalStream & ns) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_COLOR_CODE; }
 private:
        virtual Inset * clone() const;
        /// width of '[' in current font
index 2a5035d7bec7d3de79dda96f2992784f7958851b..8699cedbbad5bdeb99baaec796a7bd4a44e22caf 100644 (file)
@@ -47,6 +47,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_COMMENT_CODE; }
 private:
        virtual Inset * clone() const;
 };
index 1e09860d8ba8f186843190a916e4cc79759baf14..3fa1be7075d2174ce75a13e15f4541a32d6dfe82 100644 (file)
@@ -39,6 +39,8 @@ public:
        bool isScriptable() const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_DECORATION_CODE; }
 
 private:
        virtual Inset * clone() const;
index 3dbb39da00f0b3903f539d15398cfd6cefa118fa..de7f11442b0f7962728f2165054a51831c30abd1 100644 (file)
@@ -59,6 +59,8 @@ public:
        ///
        void octave(OctaveStream &) const;
        ///
+       InsetCode lyxCode() const { return MATH_DELIM_CODE; }
+       ///
        docstring left_;
        ///
        docstring right_;
index 8710d43fc16c34075b3f28d490f95f7e29815dad..557f16fed24580b03a2e88cb0a8761a8db681c4e 100644 (file)
@@ -44,6 +44,8 @@ public:
        void maxima(MaximaStream &) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_DIFF_CODE; }
 private:
        virtual Inset * clone() const;
 };
index f4f52716f66cd8fda1d2ff483075b016142e6c9e..ee3df2aeba7daf2432526ed1f9b4661a0ea1dbdf 100644 (file)
@@ -32,6 +32,8 @@ public:
        docstring name() const;
        /// request "external features"
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_DOTS_CODE; }
 protected:
        /// cache for the thing's height
        mutable int dh_;
index 0a6e9fe528c95d0af043547bad5e42c1fde1c8b2..d6e9a242b5d4c316baba9ff0a696533d9cb05555 100644 (file)
@@ -37,6 +37,8 @@ public:
        void write(WriteStream & os) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_ENSUREMATH_CODE; }
 private:
        virtual Inset * clone() const;
 };
index 985f57a322ca93e97b52d61e997ca215c8f8e324..035aa68e5c18469e61142f1e2e890a816d1948cb 100644 (file)
@@ -35,6 +35,8 @@ public:
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_ENV_CODE; }
 
 private:
        virtual Inset * clone() const;
index 9f91649f3d83192da07e3b5e59f8190bfc5cb597..7a5b25310f62e51622226035249492ea4ae46b39 100644 (file)
@@ -46,6 +46,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void octave(OctaveStream &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_EXFUNC_CODE; }
 
 private:
        virtual Inset * clone() const;
index d83d600bdebdebd57c9042d3ac312ac49fd23f37..00f7ed9f578554020a98acc169ea123b38a7b0c3 100644 (file)
@@ -45,6 +45,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_EXINT_CODE; }
 private:
        virtual Inset * clone() const;
        ///
index fecf7e7d43e224cdd9eb829b4fc8d148100a62fa..e002ad1a11e42e264bb49ba73cb95554814fd3ef 100644 (file)
@@ -49,6 +49,8 @@ public:
        void infoize(odocstream & os) const;
        ///
        int kerning(BufferView const * bv) const { return cell(0).kerning(bv); }
+       ///
+       InsetCode lyxCode() const { return MATH_FONT_CODE; }
 
 private:
        virtual Inset * clone() const;
index e93f3061be70fde4f5adc49472f25794bb7846b3..61d55b0e7561bd55c49e7c4cd5390d9ff7287667 100644 (file)
@@ -45,6 +45,8 @@ public:
        void infoize(odocstream & os) const;
        ///
        int kerning(BufferView const * bv) const { return cell(0).kerning(bv); }
+       ///
+       InsetCode lyxCode() const { return MATH_FONTOLD_CODE; }
 
 private:
        virtual Inset * clone() const;
index b2c55666b216835edfe4a2c44f0f25debc8169ee..3d9b3854e27f08a57479c2d76c8050248bd797df 100644 (file)
@@ -124,6 +124,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_FRAC_CODE; }
 private:
        Inset * clone() const;
        ///
index f085f99f1a86b614c9293af3c96db2c2e5516a2f..fb6edfb98965e9d43953d25ad51b451a9de64489 100644 (file)
@@ -248,6 +248,9 @@ protected:
        std::vector<ColInfo> colinfo_;
        /// cell info
        std::vector<CellInfo> cellinfo_;
+       ///
+       InsetCode lyxCode() const { return MATH_GRID_CODE; }
+
 private:
        ///
        char v_align_; // add approp. type
index c00a6819bb186824d89baa6ced2a603e96c6b534..f0eb3244d6eb045ea786724de4f55aa52fcff0ce 100644 (file)
@@ -1590,12 +1590,6 @@ void InsetMathHull::revealCodes(Cursor & cur) const
 }
 
 
-InsetCode InsetMathHull::lyxCode() const
-{
-       return MATH_CODE;
-}
-
-
 /////////////////////////////////////////////////////////////////////
 
 
index 14c1f0a3967deeca86206f363abd3cdb3f7b725e..12b3acd7d7072f7bcfabebf550e8a8a747ed0e9c 100644 (file)
@@ -142,6 +142,8 @@ public:
 
        ///
        virtual docstring contextMenu(BufferView const &, int, int) const;
+       ///
+       InsetCode lyxCode() const { return MATH_HULL_CODE; }
 
 protected:
        InsetMathHull(InsetMathHull const &);
@@ -218,8 +220,6 @@ public:
        Inset * editXY(Cursor & cur, int x, int y);
        ///
        DisplayType display() const;
-       ///
-       InsetCode lyxCode() const;
 
 protected:
        ///
index be0e82166e68768bf0ae1ef5b8cc5bb6e4aff4dc..902f19e1f3c9ebf1211986f447b8aaa97e5e91d6 100644 (file)
@@ -38,6 +38,9 @@ public:
        void write(WriteStream & os) const;
        ///
        void normalize(NormalStream & ns) const;
+       ///
+       InsetCode lyxCode() const { return MATH_KERN_CODE; }
+
 private:
        virtual Inset * clone() const;
        /// width in em
index 2a3825f2a4b82e488d7840beacce6e86a60f56b6..6742e7327e26b42d1b4d66b6bbda9dad15a5781f 100644 (file)
@@ -32,6 +32,9 @@ public:
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_LEFTEQN_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index 9ff2cbe025e18a57a602d5c855d09339e3c8a051..f10055b4362d792b409c4aa9eda3c5a8ba65e3d6 100644 (file)
@@ -42,6 +42,9 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_LIM_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index ace477a2f9cecbf6ffea1cb2d5921b348fb1a5e4..3116e7d5858eb0a0795e91e957c1da0e18a17f67 100644 (file)
@@ -51,6 +51,9 @@ public:
        ///
        void cursorPos(BufferView const & bv, CursorSlice const & sl,
                bool boundary, int & x, int & y) const;
+       ///
+       InsetCode lyxCode() const { return MATH_MBOX_CODE; }
+
 protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 
index b44008bac4cac69ab9b36760321353ec3533a940..11fa18349c0bd9750c61724235f7c1fc06753bd4 100644 (file)
@@ -43,6 +43,9 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void octave(OctaveStream &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_MATRIX_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index 6d73fbca375114f1fa37ce3a06315458cfb65e7f..7b320e61c3b4008788af704bbd2b76ff3d1dbc2c 100644 (file)
@@ -127,6 +127,8 @@ public:
        bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
        ///
        void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
+       ///
+       InsetCode lyxCode() const { return MATH_NEST_CODE; }
 
 protected:
        ///
index d9ca5a263c85f71195e3c95c8f2d32b81661881c..a6ca9dae297f60c19edbd0d21698811da34cdcf9 100644 (file)
@@ -46,6 +46,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_NUMBER_CODE; }
 
 private:
        virtual Inset * clone() const;
index e737d623e933fe00730221d19d2af9cec845cc6d..07386935506ce6de73f75f0ac98e333e1aee7f6d 100644 (file)
@@ -35,6 +35,9 @@ public:
        void normalize(NormalStream &) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_OVERSET_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index 6edc6bf8b850f4606a1e20d777332f5e81901354..05d2dabdb09a2aeb859378f96fcd014d38bb0e93 100644 (file)
@@ -34,6 +34,9 @@ public:
        void infoize(odocstream & os) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_PAR_CODE; }
+
 private:
        ///
        virtual Inset * clone() const;
index 6bfdd08c5ea19bef0ecbf1d76732e7db78d58532..9d21bbdeff3e2ecb5a43bbb56d266b7f2d8c86fd 100644 (file)
@@ -37,6 +37,9 @@ public:
        void normalize(NormalStream & ns) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_PHANTOM_CODE; }
+
 private:
        ///
        virtual Inset * clone() const;
index da324522b9de9e8be4a5531331dacb86976d57e4..b26678ce66f7b5de411f32248d2fd8848cf14d61 100644 (file)
@@ -55,6 +55,9 @@ public:
        static int getType(docstring const & name);
        ///
        static docstring const & getName(int type);
+       ///
+       InsetCode lyxCode() const { return MATH_REF_CODE; }
+
 protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
index aaa62834f3acbf3b0a37d826876564d1e4f14550..1fd6e08d0d35d96a145ad3d049ffe62bd3c947bc 100644 (file)
@@ -43,6 +43,9 @@ public:
        void mathematica(MathematicaStream &) const;
        ///
        void octave(OctaveStream &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_ROOT_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index e9be1fda6a16088c8f8c7eb0f537bccdfdd0e936..7917f0cd8c96091879bf49f29f4e708640150819 100644 (file)
@@ -102,6 +102,9 @@ public:
        void infoize(odocstream & os) const;
        /// say whether we have displayed limits
        void infoize2(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SCRIPT_CODE; }
+
 protected:
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
index 9f7dc54f0a5c131876e36b6248c0647902d29930..855b3185598ff9e678d075cbce81f25faee895ba 100644 (file)
@@ -39,6 +39,9 @@ public:
        void normalize(NormalStream &) const;
        ///
        void infoize(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SIZE_CODE; }
+
 private:
        virtual Inset * clone() const;
        ///
index f45dee5d96727f25c60556f02842b156ad2c37db..5770439660ca827645d851409b32c36cd3b322dd 100644 (file)
@@ -61,6 +61,9 @@ public:
        docstring contextMenu(BufferView const &, int, int) const;
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SPACE_CODE; }
+
 protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
index 20bc9d97743ba8483dd22dd55ec67bbdebd7c7c9..c672b504f688045bce4ba1acabf181f25f7ad756 100644 (file)
@@ -52,6 +52,8 @@ public:
        docstring name() const { return name_; }
        ///
        char_type getChar() const { return char_; }
+       ///
+       InsetCode lyxCode() const { return MATH_SPECIALCHAR_CODE; }
 
 private:
        virtual Inset * clone() const;
index 4f92d59ae7dfcea3bb8b746bc0a12b174031abf0..9a8d4b93d4e7056695dc1e0371247945000b0acf 100644 (file)
@@ -37,6 +37,9 @@ public:
        int defaultColSpace(col_type) { return 0; }
        ///
        char defaultColAlign(col_type);
+       ///
+       InsetCode lyxCode() const { return MATH_SPLIT_CODE; }
+
 private:
        ///
        virtual Inset * clone() const;
index 7fd6452e6aaac1a639e846c88afceb9bfe619dad..aaa1ac03c087c1c5580b7a0b7db6b70d1f454f05 100644 (file)
@@ -45,6 +45,9 @@ public:
        void octave(OctaveStream &) const;
        ///
        void mathmlize(MathStream &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SQRT_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index f9404241684a53d4d0b1c96cb1cd487f4ee39fda..b27f1cd8b7487e817c59e6b821702df204ec3082 100644 (file)
@@ -36,6 +36,9 @@ public:
        void write(WriteStream & os) const;
        ///
        void normalize(NormalStream &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_STACKREL_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index 9544503041b25788ec4d78c6d998224a1a0e50a1..9f94a7457fe986f056a7054fe1f159e5ceded9c4 100644 (file)
@@ -50,6 +50,8 @@ public:
        void mathmlize(MathStream &) const;
        ///
        void write(WriteStream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_STRING_CODE; }
 
 private:
        virtual Inset * clone() const;
index 045366bf6c649d9f767857730317a9b01cfdc73c..c0576aaa6bd16253d5195df4b7f711529eb8f380 100644 (file)
@@ -44,6 +44,9 @@ public:
        void maple(MapleStream &) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SUBSTACK_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index 25c1a8d9f01ba7f81010d692d462b31cfd819f3e..5382f72e85712f3fe7ed510465eefdd683070165 100644 (file)
@@ -68,6 +68,8 @@ public:
        void write(WriteStream & os) const;
        ///
        void infoize2(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SYMBOL_CODE; }
 
 private:
        virtual Inset * clone() const;
index db96bc89397cc0e157e934f4d8e17b9e3a7ca50d..0fb6c27961cc96b31b0f2b1cb5d5fa2858e8f335 100644 (file)
@@ -45,6 +45,8 @@ public:
        void normalize(NormalStream &) const;
        ///
        void maple(MapleStream &) const;
+       ///
+       InsetCode lyxCode() const { return MATH_TABULAR_CODE; }
 
 private:
        Inset * clone() const;
index 51311e6c6fb56e6a5c06a449c6c49dbf9395d9f5..321f26fef0cbd3d9d1d8c44fd0b0f4272f9ba62f 100644 (file)
@@ -37,6 +37,9 @@ public:
        void normalize(NormalStream & ns) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_UNDERSET_CODE; }
+
 private:
        virtual Inset * clone() const;
 };
index c51bc15980a6aac50d55455e3c972a19c202584f..b43bcfd6721a010e594b4dfba2d3ee8645f8495d 100644 (file)
@@ -59,6 +59,8 @@ public:
        bool final() const;
        ///
        int kerning(BufferView const *) const { return kerning_; }
+       ///
+       InsetCode lyxCode() const { return MATH_UNKNOWN_CODE; }
 
 private:
        ///
index bf668eaab718952df4115aba5c6247a9300fac47..d21dd422224422e14ab9e78c7126ed32a05b7afe 100644 (file)
@@ -33,6 +33,8 @@ public:
        void normalize(NormalStream & os) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_XARROW_CODE; }
 
 private:
        virtual Inset * clone() const;
index 50c7a043c87535d79d13485016cd479d133954a3..75734bb856f7bfedec23c97ae13855b952d138e2 100644 (file)
@@ -42,14 +42,14 @@ public:
        void write(WriteStream & os) const;
        ///
        void normalize(NormalStream &) const;
-
-public:
        ///
        InsetMathXYMatrix const * targetMatrix() const;
        ///
        MathData const & targetCell() const;
        ///
        MathData const & sourceCell() const;
+       ///
+       InsetCode lyxCode() const { return MATH_XYARROW_CODE; }
 
        ///
        bool up_;
index 4453d00d658e1a2d7cd56b63c5dbf699c17609f9..8e11a0b489bf64c4d344448d10975fb9adc24081 100644 (file)
@@ -44,6 +44,9 @@ public:
        void maple(MapleStream &) const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       InsetCode lyxCode() const { return MATH_XYMATRIX_CODE; }
+
 private:
        ///
        virtual Inset * clone() const;
index b2e50d119168f0d3698199faa22f68428779c6d4..d686f421c4e6d41ab7df6acf4584f69bc436cc71 100644 (file)
@@ -85,7 +85,7 @@ void MacroData::expand(vector<MathData> const & args, MathData & to) const
        for (DocIterator it = doc_iterator_begin(buffer, &inset); it; it.forwardChar()) {
                if (!it.nextInset())
                        continue;
-               if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+               if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
                        continue;
                //it.cell().erase(it.pos());
                //it.cell().insert(it.pos(), it.nextInset()->asInsetMath()
index 5edac1df786bfd7df3cc63bc82068532135e1ef7..801c19dfb8d9d5972028aa31b82406cbacc857f2 100644 (file)
@@ -120,6 +120,8 @@ public:
        }
        /// Return the maximal number of arguments the macro is greedy for.
        size_t appetite() const { return appetite_; }
+       ///
+       InsetCode lyxCode() const { return MATH_MACRO_CODE; }
 
 protected:
        friend class MathData;
index c3d364b727c50e8e3910b1b2bc7465ff9af27df4..4a52b1a1d20fda1e63a2bae1096a095cd63f694b 100644 (file)
@@ -35,7 +35,7 @@ public:
        ///
        void setNumber(int n);
        ///
-       InsetCode lyxCode() const { return MATHMACROARG_CODE; }
+       InsetCode lyxCode() const { return MATH_MACROARG_CODE; }
 
        ///
        void normalize(NormalStream &) const;
index 6765f01a99783b8980d014da7c4de850785ee52d..3014cc4ee7af923a4dadb6e6955f6f0c0db1f53b 100644 (file)
@@ -635,7 +635,7 @@ void MathMacroTemplate::removeArguments(Cursor & cur, int from, int to)
        for (DocIterator it = doc_iterator_begin(&buffer(), this); it; it.forwardChar()) {
                if (!it.nextInset())
                        continue;
-               if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+               if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
                        continue;
                MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
                int n = arg->number() - 1;
@@ -657,7 +657,7 @@ void MathMacroTemplate::shiftArguments(size_t from, int by)
        for (DocIterator it = doc_iterator_begin(&buffer(), this); it; it.forwardChar()) {
                if (!it.nextInset())
                        continue;
-               if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+               if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
                        continue;
                MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
                if (arg->number() >= int(from) + 1)
@@ -676,7 +676,7 @@ int MathMacroTemplate::maxArgumentInDefinition() const
        for (; it; it.forwardChar()) {
                if (!it.nextInset())
                        continue;
-               if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+               if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
                        continue;
                MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
                maxArg = std::max(int(arg->number()), maxArg);
@@ -696,7 +696,7 @@ void MathMacroTemplate::insertMissingArguments(int maxArg)
        for (; it && it[0].idx() == idx; it.forwardChar()) {
                if (!it.nextInset())
                        continue;
-               if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+               if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
                        continue;
                MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
                found[arg->number() - 1] = true;
index dea1acf28ed406992056c2ed3e2cbc236ebda39b..0898df46fe1a8489299acb1eea45abdc9e098ae4 100644 (file)
@@ -100,7 +100,6 @@ public:
        void infoize(odocstream & os) const;
        ///
        docstring contextMenu(BufferView const &, int, int) const;
-
 protected:
        ///
        virtual void doDispatch(Cursor & cur, FuncRequest & cmd);