git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3470 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-02-01 11:57:26 +00:00
parent 66d171ea78
commit fcb622b800
3 changed files with 19 additions and 3 deletions

View File

@ -203,8 +203,11 @@ bool MathCursor::popLeft()
//cerr << "Leaving atom "; par()->write(cerr, false); cerr << " left\n";
if (Cursor_.size() <= 1)
return false;
if (par()->asScriptInset())
if (par()->asScriptInset()) {
par()->asScriptInset()->removeEmptyScripts();
if (par()->asScriptInset()->empty())
plainErase();
}
Cursor_.pop_back();
return true;
}
@ -215,8 +218,11 @@ bool MathCursor::popRight()
//cerr << "Leaving atom "; par()->write(cerr, false); cerr << " right\n";
if (Cursor_.size() <= 1)
return false;
if (par()->asScriptInset())
if (par()->asScriptInset()) {
par()->asScriptInset()->removeEmptyScripts();
if (par()->asScriptInset()->empty())
plainErase();
}
Cursor_.pop_back();
posRight();
return true;

View File

@ -187,7 +187,9 @@ void MathScriptInset::metrics(MathMetricsInfo const & mi) const
void MathScriptInset::metrics(MathInset const * nuc,
MathMetricsInfo const & mi) const
{
MathNestInset::metrics(mi);
mi_ = mi;
smallerStyleScript(mi_);
MathNestInset::metrics(mi_);
if (nuc)
nuc->metrics(mi);
ascent_ = ascent2(nuc);
@ -264,6 +266,12 @@ bool MathScriptInset::has(bool up) const
}
bool MathScriptInset::empty() const
{
return !script_[0] && !script_[1];
}
bool MathScriptInset::hasUp() const
{
return script_[1];

View File

@ -68,6 +68,8 @@ public:
bool hasDown() const;
/// do we have a script?
bool has(bool up) const;
/// do we have a anything?
bool empty() const;
/// remove script
void removeScript(bool up);
/// remove script