4 #include "support/LOstream.h"
10 #include "math_scriptinset.h"
13 MathScriptInset::MathScriptInset(bool up)
14 : MathNestInset(1), up_(up)
18 MathInset * MathScriptInset::clone() const
20 return new MathScriptInset(*this);
25 bool MathScriptInset::idxUp(int & idx, int & pos) const
27 if (idx == 0 || !up())
34 bool MathScriptInset::idxDown(int & idx, int & pos) const
36 if (idx == 1 || !down())
43 bool MathScriptInset::idxFirst(int & idx, int & pos) const
50 bool MathScriptInset::idxLast(int & idx, int & pos) const
53 pos = cell(idx).size();
58 bool MathScriptInset::idxFirstUp(int & idx, int & pos) const
68 bool MathScriptInset::idxFirstDown(int & idx, int & pos) const
78 bool MathScriptInset::idxLastUp(int & idx, int & pos) const
83 pos = cell(idx).size();
88 bool MathScriptInset::idxLastDown(int & idx, int & pos) const
93 pos = cell(idx).size();
97 void MathScriptInset::idxDelete(int & idx, bool & popit, bool & deleteit)
104 deleteit = !(up() || down());
110 void MathScriptInset::write(std::ostream & os, bool fragile) const
112 cell(0).write(os, fragile);
116 void MathScriptInset::metrics(MathStyles st) const
119 xcell(0).metrics(st);
120 width_ = xcell(0).width();
121 ascent_ = xcell(0).ascent();
122 descent_ = xcell(0).descent();
126 void MathScriptInset::draw(Painter & pain, int x, int y) const
130 xcell(0).draw(pain, x, y);