lyx_mirror/src/mathed/math_scriptinset.C
André Pönitz 4665fc9c30 remove unneeded #includes, cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2232 a592a061-630c-0410-9148-cb99ea01b6c8
2001-07-13 09:54:32 +00:00

44 lines
687 B
C

#ifdef __GNUG__
#pragma implementation
#endif
#include "math_scriptinset.h"
#include "support/LOstream.h"
MathScriptInset::MathScriptInset(bool up, bool down)
: MathUpDownInset(up, down)
{}
MathInset * MathScriptInset::clone() const
{
return new MathScriptInset(*this);
}
void MathScriptInset::WriteNormal(std::ostream & os) const
{
if (up()) {
os << "[superscript ";
cell(0).WriteNormal(os);
os << "] ";
}
if (down()) {
os << "[subscript ";
cell(1).WriteNormal(os);
os << "] ";
}
}
void MathScriptInset::idxDelete(int & idx, bool & popit, bool & deleteit)
{
if (idx == 0)
up(false);
else
down(false);
popit = true;
deleteit = !(up() || down());
}