cosmetics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4549 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-07-08 13:03:37 +00:00
parent 4eb4e9ba98
commit b87536ec46
5 changed files with 21 additions and 10 deletions

View File

@ -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
}

View File

@ -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", ""},

View File

@ -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 ");
}

View File

@ -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;

View File

@ -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();
}