mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 11:16:55 +00:00
fix #218
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3470 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
66d171ea78
commit
fcb622b800
@ -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;
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user