]> git.lyx.org Git - features.git/commitdiff
crude support for a few more AMS constructs
authorAndré Pönitz <poenitz@gmx.net>
Wed, 29 May 2002 15:58:26 +0000 (15:58 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 29 May 2002 15:58:26 +0000 (15:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4280 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_dotsinset.C
src/mathed/math_hash.C
src/mathed/math_support.C

index fd2585452304cfef55f29777960a16efcbc8365e..839af0d3602ac319de5c0ac548cbc430d825588d 100644 (file)
@@ -26,22 +26,26 @@ void MathDotsInset::metrics(MathMetricsInfo const & mi) const
        LyXFont font;
        whichFont(font, LM_TC_VAR, mi);
        mathed_char_dim(font, 'M', ascent_, descent_, width_);
-       switch (name_[0]) {
-               case 'l': dh_ = 0; break;
-               case 'c': dh_ = ascent_ / 2; break;
-               case 'v': width_ /= 2;
-               case 'd': dh_ = ascent_; break;
-       }
+       if (name_ == "ldots" || name_ == "dotsm") 
+               dh_ = 0;
+       else if (name_ == "cdots" || name_ == "dotsb"
+                       || name_ == "dotsm" || name_ == "dotsi")
+               dh_ = ascent_ / 2;
+       else if (name_ == "dotsc")
+               dh_ = ascent_ / 4;
+       else if (name_ == "vdots")
+               width_ /= 2;
+       else if (name_ == "ddots")
+               dh_ = ascent_;
 }
 
 
 void MathDotsInset::draw(Painter & pain, int x, int y) const
 {
        mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
-       char const c = name_[0];
-       if (c == 'v' || c == 'd')
+       if (name_ == "vdots" || name_ == "ddots")
                ++x;
-       if (c != 'v')
+       if (name_ != "vdots")
                --y;
        mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
 }
index 8a56952d2b3aba8041a9ace465eb2ab3b45148c5..dbf5d58da4884764c63182fab192c5711d6a2ec9 100644 (file)
@@ -68,6 +68,11 @@ key_type wordlist_array[] =
        {"ddot",  LM_TK_DECORATION, 0},
        {"dddot",  LM_TK_DECORATION, 0},
        {"ddots",  LM_TK_DOTS, 0},
+       {"dotsb",  LM_TK_DOTS, 0},
+       {"dotsc",  LM_TK_DOTS, 0},
+       {"dotsi",  LM_TK_DOTS, 0},
+       {"dotsm",  LM_TK_DOTS, 0},
+       {"dotso",  LM_TK_DOTS, 0},
        {"deg",  LM_TK_FUNC, 0},
        {"det",  LM_TK_FUNCLIM, 0},
        {"dim",  LM_TK_FUNC, 0},
index 6c2ba5c470715c5c4b3026f1b1ef72f358a14769..962e0e09c05e6cebfbc74c2097cd731718036139 100644 (file)
@@ -524,7 +524,12 @@ named_deco_struct deco_table[] = {
        {"ldots",          hline3,     0 },
        {"cdots",          hline3,     0 },
        {"vdots",          hline3,     1 },
-       {"ddots",          dline3,     0 }
+       {"ddots",          dline3,     0 },
+       {"dotsb",          hline3,     0 },
+       {"dotsc",          hline3,     0 },
+       {"dotsi",          hline3,     0 },
+       {"dotsm",          hline3,     0 },
+       {"dotso",          hline3,     0 }
 };