]> git.lyx.org Git - lyx.git/blob - src/mathed/math_scriptinset.C
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / math_scriptinset.C
1 #ifdef __GNUG__
2 #pragma implementation
3 #endif
4
5 #include "math_scriptinset.h"
6 #include "support/LOstream.h"
7
8
9 MathScriptInset::MathScriptInset(bool up, bool down)
10         : MathUpDownInset(up, down)
11 {}
12
13
14 MathInset * MathScriptInset::clone() const
15 {   
16         return new MathScriptInset(*this);
17 }
18
19
20 void MathScriptInset::WriteNormal(std::ostream & os) const
21 {
22         if (up()) {
23                 os << "[superscript ";
24                 cell(0).WriteNormal(os);
25                 os << "] ";
26         }
27         if (down()) {
28                 os << "[subscript ";
29                 cell(1).WriteNormal(os);
30                 os << "] ";
31         }
32 }
33
34
35 void MathScriptInset::idxDelete(int & idx, bool & popit, bool & deleteit)
36 {
37         if (idx == 0) 
38                 up(false);
39         else
40                 down(false);
41         popit = true;
42         deleteit = !(up() || down());
43 }