no special treatment for scriptinsets

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4826 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-08-01 11:48:53 +00:00
parent 2e835ba909
commit 0fdd672d64
3 changed files with 14 additions and 7 deletions

View File

@ -189,8 +189,6 @@ bool MathCursor::inNucleus() const
bool MathCursor::posLeft() bool MathCursor::posLeft()
{ {
if (inNucleus())
return false;
if (pos() == 0) if (pos() == 0)
return false; return false;
--pos(); --pos();
@ -454,6 +452,7 @@ void MathCursor::backspace()
return; return;
} }
/*
if (prevAtom()->asScriptInset()) { if (prevAtom()->asScriptInset()) {
// simply enter nucleus // simply enter nucleus
left(); left();
@ -465,6 +464,7 @@ void MathCursor::backspace()
if (pos() == 1) { if (pos() == 1) {
} }
} }
*/
--pos(); --pos();
plainErase(); plainErase();
@ -493,6 +493,7 @@ void MathCursor::erase()
return; return;
} }
/*
// if we are standing in front of a script inset, grab item before us and // if we are standing in front of a script inset, grab item before us and
// move it into nucleus // move it into nucleus
// and remove first thing. // and remove first thing.
@ -513,6 +514,7 @@ void MathCursor::erase()
} }
return; return;
} }
*/
plainErase(); plainErase();
} }

View File

@ -31,7 +31,11 @@ MathInset * MathFontInset::clone() const
MathInset::mode_type MathFontInset::currentMode() const MathInset::mode_type MathFontInset::currentMode() const
{ {
return key_->extra == "mathmode" ? MATH_MODE : TEXT_MODE; if (key_->extra == "mathmode")
return MATH_MODE;
if (key_->extra == "textmode")
return TEXT_MODE;
return UNDECIDED_MODE;
} }

View File

@ -60,7 +60,7 @@ MathScriptInset * MathScriptInset::asScriptInset()
bool MathScriptInset::idxFirst(idx_type & idx, pos_type & pos) const bool MathScriptInset::idxFirst(idx_type & idx, pos_type & pos) const
{ {
idx = 2; idx = 2;
pos = nuc().size(); pos = 0;
return true; return true;
} }
@ -202,7 +202,7 @@ void MathScriptInset::metrics(MathMetricsInfo & mi) const
} }
dim_.a = dy1() + (hasUp() ? up().ascent() : 0); dim_.a = dy1() + (hasUp() ? up().ascent() : 0);
dim_.d = dy0() + (hasDown() ? down().descent() : 0); dim_.d = dy0() + (hasDown() ? down().descent() : 0);
metricsMarkers(); metricsMarkers2();
} }
@ -217,7 +217,7 @@ void MathScriptInset::draw(MathPainterInfo & pi, int x, int y) const
up().draw(pi, x + dx1(), y - dy1()); up().draw(pi, x + dx1(), y - dy1());
if (hasDown()) if (hasDown())
down().draw(pi, x + dx0(), y + dy0()); down().draw(pi, x + dx0(), y + dy0());
drawMarkers(pi, x, y); drawMarkers2(pi, x, y);
} }
@ -460,6 +460,7 @@ void MathScriptInset::octavize(OctaveStream & os) const
void MathScriptInset::infoize(std::ostream & os) const void MathScriptInset::infoize(std::ostream & os) const
{ {
os << "Scripts";
if (limits_) if (limits_)
os << (limits_ == 1 ? "Displayed limits" : "Inlined limits"); os << (limits_ == 1 ? ", Displayed limits" : ", Inlined limits");
} }