-MathedInset * MathSpaceInset::Clone()
-{
- return new MathSpaceInset(space, GetType(), GetStyle());
-}
-
-
-MathParInset::MathParInset(short st, char const * nm, short ot)
- : MathedInset(nm, ot, st)
-{
- array = 0;
- ascent = 8;
- width = 4;
- descent = 0;
- flag = 1;
- if (objtype == LM_OT_SCRIPT)
- flag |= LMPF_SCRIPT;
-}
-
-
-MathParInset::MathParInset(MathParInset * p)
- : MathedInset(p)
-{
- flag = p->flag;
- p->setArgumentIdx(0);
- MathedIter it(p->GetData());
- SetData(it.Copy());
-}
-
-
-MathParInset::~MathParInset()
-{
- if (array) {
- MathedIter it(array);
- it.Clear();
- delete array;
- }
-}
-
-
-MathedInset * MathParInset::Clone()
-{
- return new MathParInset(this);
-}
-
-
-void MathParInset::SetData(LyxArrayBase * a)
-{
- array = a;
-
- // A standard paragraph shouldn't have any tabs nor CRs.
- if (array) {
- MathedIter it(array);
- while (it.OK()) {
- char c = it.GetChar();
- if (c == LM_TC_TAB || c == LM_TC_CR)
- it.Delete();
- else
- it.Next();
- }
- }
-}
-
-
-MathSqrtInset::MathSqrtInset(short st)
- : MathParInset(st, "sqrt", LM_OT_SQRT) {}
-
-
-MathedInset * MathSqrtInset::Clone()
-{
- MathSqrtInset * p = new MathSqrtInset(GetStyle());
- MathedIter it(array);
- p->SetData(it.Copy());
- return p;
-}
-
-
-bool MathSqrtInset::Inside(int x, int y)
-{
- return x >= xo - hmax
- && x <= xo + width - hmax
- && y <= yo + descent
- && y >= yo - ascent;
-}
-
-
-MathDelimInset::MathDelimInset(int l, int r, short st)
- : MathParInset(st, "", LM_OT_DELIM), left(l), right(r) {}
-
-
-MathedInset * MathDelimInset::Clone()
-{
- MathDelimInset * p = new MathDelimInset(left, right, GetStyle());
- MathedIter it(array);
- p->SetData(it.Copy());
- return p;
-}
-
-
-MathDecorationInset::MathDecorationInset(int d, short st)
- : MathParInset(st, "", LM_OT_DECO), deco(d)
-{
- upper = (deco!= LM_underline && deco!= LM_underbrace);
-}
-
-
-MathedInset * MathDecorationInset::Clone()
-{
- MathDecorationInset * p = new MathDecorationInset(deco, GetStyle());
- MathedIter it(array);
- p->SetData(it.Copy());
- return p;
-}
-
-
-MathFracInset::MathFracInset(short ot)
- : MathParInset(LM_ST_TEXT, "frac", ot)
-{
+// In a near future maybe we use a better fonts renderer
+void MathedInset::drawStr(Painter & pain, short type, int siz,
+ int x, int y, string const & s)
+{
+ string st;
+ if (MathIsBinary(type))
+ for (string::const_iterator it = s.begin();
+ it != s.end(); ++it) {
+ st += ' ';
+ st += *it;
+ st += ' ';
+ }
+ else
+ st = s;