From b87536ec46dc62322cacd598fddb965261f11c1b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 8 Jul 2002 13:03:37 +0000 Subject: [PATCH] cosmetics git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4549 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_cursor.C | 9 +++++---- src/mathed/math_factory.C | 3 --- src/mathed/math_scriptinset.C | 9 ++++++++- src/mathed/math_scriptinset.h | 3 ++- src/mathed/math_symbolinset.C | 7 ++++++- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 323e8bfe88..a0b5e7578c 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1571,14 +1571,15 @@ void MathCursor::insetToggle() string MathCursor::info() const { ostringstream os; - os << "Math editor mode "; + os << "Math editor mode. "; for (int i = 0, n = depth(); i < n; ++i) { Cursor_[i].par_->infoize(os); os << " "; } - //if (pos() > 0) - // prevAtom()->infoize(os); - os << " "; + if (hasPrevAtom()) + if (prevAtom()->asSymbolInset() || prevAtom()->asScriptInset()) + prevAtom()->infoize(os); + os << " "; return os.str().c_str(); // .c_str() needed for lyxstring } diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index adf2136607..8ec5239513 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -99,7 +99,6 @@ key_type wordlist_array[] = {"label", "label", ""}, {"ldots", "dots", ""}, {"left", "left", ""}, - {"limits", "limit", ""}, {"lyxnegspace", "space", ""}, {"lyxposspace", "space", ""}, {"mathbb", "font", ""}, @@ -115,8 +114,6 @@ key_type wordlist_array[] = {"matrix", "matrix", ""}, {"mbox", "mbox", ""}, {"newcommand", "newcommand", ""}, - {"nolimits", "limit", ""}, - {"nonumber", "nonum", ""}, {"overbrace", "decoration", ""}, {"overleftarrow", "decoration", ""}, {"overline", "decoration", ""}, diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index c1cb90af0b..6b448903c0 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -261,7 +261,7 @@ void MathScriptInset::drawT(MathInset const * nuc, TextPainter & pain, bool MathScriptInset::hasLimits(MathInset const * nuc) const { - // obviuos cases + // obvious cases if (limits_ == 1) return true; if (limits_ == -1) @@ -463,3 +463,10 @@ void MathScriptInset::octavize2(MathInset const * nuc, OctaveStream & os) const if (hasUp() && up().data_.size()) os << "^(" << up().data_ << ')'; } + + +void MathScriptInset::infoize(std::ostream & os) const +{ + if (limits_) + os << (limits_ == 1 ? "Displayed limits " : "Inlined limits "); +} diff --git a/src/mathed/math_scriptinset.h b/src/mathed/math_scriptinset.h index d87bebd1f2..913756ec2f 100644 --- a/src/mathed/math_scriptinset.h +++ b/src/mathed/math_scriptinset.h @@ -86,6 +86,8 @@ public: void removeEmptyScripts(); /// make sure a script is accessible void ensure(bool up); + /// + void MathScriptInset::infoize(std::ostream & os) const; // call these methods ...2 to make compaq cxx in anal mode happy... /// suppresses empty braces if necessary @@ -95,7 +97,6 @@ public: virtual void maplize2(MathInset const * nuc, MapleStream & os) const; virtual void mathematicize2(MathInset const * nuc, MathematicaStream & os) const; virtual void mathmlize2(MathInset const * nuc, MathMLStream & os) const; - public: /// returns x offset for main part int dxx(MathInset const * nuc) const; diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index 761cebfa65..e862aa53ec 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -56,6 +56,9 @@ void MathSymbolInset::metrics(MathMetricsInfo & mi) const } if (isRelOp()) width_ += 6; + // seperate things a bit + if (sym_->draw.size() > 1) + width_ += 2; scriptable_ = false; if (mi.base.style == LM_ST_DISPLAY) @@ -72,6 +75,8 @@ void MathSymbolInset::draw(MathPainterInfo & pi, int x, int y) const // << "'\n"; if (isRelOp()) x += 3; + if (sym_->draw.size() > 1) + x += 1; MathFontSetChanger dummy(pi.base, sym_->inset.c_str()); drawStr(pi, pi.base.font, x, y - h_, sym_->draw); } @@ -173,5 +178,5 @@ void MathSymbolInset::write(WriteStream & os) const void MathSymbolInset::infoize(ostream & os) const { - os << '\\' << name(); + os << "Symbol: " << name(); } -- 2.39.2