]> git.lyx.org Git - features.git/commitdiff
small cleanups
authorAndré Pönitz <poenitz@gmx.net>
Thu, 26 Jul 2001 13:52:47 +0000 (13:52 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 26 Jul 2001 13:52:47 +0000 (13:52 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2359 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_bigopinset.C
src/mathed/math_cursor.C
src/mathed/math_defs.h
src/mathed/math_funcinset.C
src/mathed/math_funcinset.h
src/mathed/math_hash.C
src/mathed/math_parser.C
src/mathed/math_parser.h

index cda49613db69e6c983c9fb801ce34c0eb63e4af1..a6dbc948c605a686672f08b7edba3379c885a8f6 100644 (file)
@@ -32,10 +32,10 @@ void MathBigopInset::writeNormal(ostream & os) const
 
 void MathBigopInset::metrics(MathStyles st)
 {
-       //cerr << "\nBigopDraw\n";
+       //cerr << "\nBigopDraw: " << name_ << ": " << sym_ << "\n";
        size(st);
        
-       if (sym_ < 256 || sym_ == LM_oint) {
+       if (sym_ && (sym_ < 256 || sym_ == LM_oint)) {
                ssym_ = string();
                ssym_ += (sym_ == LM_oint) ? LM_int : sym_;
                code_ = LM_TC_BSYM;
index 73095ef42f30c19ad8aabbf041ce1fbae8ce3a14..d8ec314f5ceeffcea2b384eb9b11eff59ab4a01d 100644 (file)
@@ -602,7 +602,10 @@ void MathCursor::interpret(string const & s)
        //lyxerr << "interpret: '" << s << "'\n";
        //lyxerr << "in: " << in_word_set(s) << " \n";
 
-       if (s.size() && (s[0] == '^' || s[0] == '_')) {
+       if (s.empty())
+               return;
+
+       if (s[0] == '^' || s[0] == '_') {
                bool const up = (s[0] == '^');
                selCut();       
                MathScriptInset * p = prevScriptInset();
@@ -659,10 +662,11 @@ void MathCursor::interpret(string const & s)
                        p = pp;
                }
                else
-                       p = new MathFuncInset(s, LM_OT_UNDEF);
+                       p = new MathFuncInset(s);
        } else {
                switch (l->token) {
                        case LM_TK_BIGSYM: 
+                       case LM_TK_FUNCLIM:
                                p = new MathBigopInset(s, l->id);
                                break;
                                
@@ -691,10 +695,6 @@ void MathCursor::interpret(string const & s)
                                p = new MathDecorationInset(l->name, l->id);
                                break;
 
-                       case  LM_TK_FUNCLIM:
-                               p = new MathFuncInset(l->name, LM_OT_FUNCLIM);
-                               break;
-
                        case LM_TK_SPACE:
                                p = new MathSpaceInset(l->id);
                                break;
index 356ec41193233bd0a5fd3e165aab6c49c94d7376..3d048b0162b8357eba31c6493a29e7c77ad3db27 100644 (file)
@@ -117,8 +117,6 @@ enum MathInsetTypes  {
        /// A LaTeX macro
        LM_OT_UNDEF,
        ///
-       LM_OT_FUNC,
-       ///
        LM_OT_FUNCLIM,
        ///
        LM_OT_MACRO,
index e0ce29cddff29b83057707e12102a05749fb13f5..0f72e2988777c83f95255f1b7f226d2b4dda3408 100644 (file)
@@ -14,11 +14,9 @@ using std::ostream;
 extern LyXFont WhichFont(short type, int size);
 
 
-MathFuncInset::MathFuncInset(string const & nm, MathInsetTypes ot)
-       : MathInset(0, nm, ot)
-{
-       lims_ = (getType() == LM_OT_FUNCLIM);
-}
+MathFuncInset::MathFuncInset(string const & nm)
+       : MathInset(0, nm)
+{}
 
 
 MathInset * MathFuncInset::clone() const
index e054574781917ff5f83986812baa56d4567d68e1..781d40ccc00219f160c73ac29a501d2fadc2fcf1 100644 (file)
@@ -15,7 +15,7 @@
 class MathFuncInset : public MathInset {
 public:
        ///
-       explicit MathFuncInset(string const & nm, MathInsetTypes ot = LM_OT_FUNC);
+       explicit MathFuncInset(string const & nm);
        ///
        virtual MathInset * clone() const;
        ///
@@ -26,8 +26,5 @@ public:
        void writeNormal(std::ostream &) const;
        ///
        void metrics(MathStyles st);
-private:
-       ///
-       bool lims_;
 };
 #endif
index 2ae68b1e6d295b54a8e3a2ee3dc105b071c5a9b1..6c2c4c43653235c829676da250144bec55bb76c6 100644 (file)
@@ -200,7 +200,7 @@ latexkeys const wordlist[] =
        {"phi",  LM_TK_SYM, LM_phi, LMB_NONE},
        {"pi",  LM_TK_SYM, LM_pi, LMB_NONE},
        {"pm",  LM_TK_SYM, LM_pm, LMB_OPERATOR},
-       {"pmod",  LM_TK_PMOD, 0, LMB_NONE},
+       //{"pmod",  LM_TK_SYM, 0, LMB_NONE},
        {"prec",  LM_TK_SYM, LM_prec, LMB_RELATION},
        {"preceq",  LM_TK_SYM, LM_preceq, LMB_RELATION},
        {"prime",  LM_TK_SYM, LM_prime, LMB_NONE},
index be27ce54a5ae8e001d58ab28c168eddf9abb2071..a9839b8dd2c16533401c7d38680050c0795e956f 100644 (file)
@@ -631,9 +631,8 @@ void mathed_parse(MathArray & array, unsigned flags)
                        break;
                
                case LM_TK_BIGSYM:  
-                       //lyxerr << "clearing limits " << limits << "\n";
+               case LM_TK_FUNCLIM:
                        limits = 0;
-                       //lyxerr << "found bigop '" << yylval.l->name << "'\n";
                        array.push_back(new MathBigopInset(yylval.l->name, yylval.l->id));
                        break;
                
@@ -746,15 +745,10 @@ void mathed_parse(MathArray & array, unsigned flags)
                        curr_num = false;
                        break;
                
-               case LM_TK_PMOD:
                case LM_TK_FUNC:
                        array.push_back(new MathFuncInset(yylval.l->name));
                        break;
                
-               case LM_TK_FUNCLIM:
-                       array.push_back(new MathFuncInset(yylval.l->name, LM_OT_FUNCLIM));
-                       break;
-
                case LM_TK_UNDEF: 
                        if (MathMacroTable::hasTemplate(yytext)) {
                                MathMacro * m = MathMacroTable::cloneTemplate(yytext);
@@ -763,7 +757,7 @@ void mathed_parse(MathArray & array, unsigned flags)
                                array.push_back(m);
                                m->metrics(LM_ST_TEXT);
                        } else
-                               array.push_back(new MathFuncInset(yytext, LM_OT_UNDEF));
+                               array.push_back(new MathFuncInset(yytext));
                        break;
                
                case LM_TK_END:
index 64629e5e059a33a914590216e0792ea90b2bd675..02e16a885457d1a889c9325c0e3584fcc493f89e 100644 (file)
@@ -84,10 +84,6 @@ enum MathTokenEnum
        ///
        LM_TK_STY,
        ///
-       LM_TK_PMOD,
-       ///
-       LM_TK_BMOD,
-       ///
        LM_TK_MACRO,
        ///
        LM_TK_SPECIAL,