From 6a0b1fe001fac6db6c5731cd5b948b53fb204a55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 29 May 2002 15:58:26 +0000 Subject: [PATCH] crude support for a few more AMS constructs git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4280 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_dotsinset.C | 22 +++++++++++++--------- src/mathed/math_hash.C | 5 +++++ src/mathed/math_support.C | 7 ++++++- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/mathed/math_dotsinset.C b/src/mathed/math_dotsinset.C index fd25854523..839af0d360 100644 --- a/src/mathed/math_dotsinset.C +++ b/src/mathed/math_dotsinset.C @@ -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_); } diff --git a/src/mathed/math_hash.C b/src/mathed/math_hash.C index 8a56952d2b..dbf5d58da4 100644 --- a/src/mathed/math_hash.C +++ b/src/mathed/math_hash.C @@ -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}, diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index 6c2ba5c470..962e0e09c0 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -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 } }; -- 2.39.2