]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.C
mathed34.diff
[lyx.git] / src / mathed / formula.C
index acd8c3c2efc879d069492ff2544d217f5b388b14..a4185a9cdcc6275b026264a8c3993c6139a967c2 100644 (file)
@@ -227,7 +227,7 @@ InsetFormula::InsetFormula(MathParInset * p)
 
        par = is_multiline(p->GetType()) ?
                new MathMatrixInset(static_cast<MathMatrixInset*>(p)):
-               new MathParInset(p);
+               new MathParInset(*p);
        //   mathcursor = 0;
 
        disp_flag = (par->GetType()>0);
@@ -305,7 +305,8 @@ void InsetFormula::Read(Buffer const *, LyXLex & lex)
        // Silly hack to read labels.
        mathed_label.erase();
 
-       mathed_parse(0, 0, &par);
+       MathedArray ar;
+       mathed_parse(ar, 0, &par);
        par->Metrics();
        disp_flag = (par->GetType() > 0);
 
@@ -537,9 +538,6 @@ void InsetFormula::display(bool dspf)
                        par->SetStyle(LM_ST_DISPLAY);
                } else {
                        if (is_multiline(par->GetType())) {
-                               MathParInset * p = new MathParInset(par);
-                               delete par;
-                               par = p;
                                if (mathcursor)
                                        mathcursor->SetPar(par);
                        }
@@ -1227,7 +1225,7 @@ InsetFormula::LocalDispatch(BufferView * bv, int action, string const & arg)
 static
 void mathedValidate(LaTeXFeatures & features, MathParInset * par)
 {
-       MathedIter it(par->GetData());
+       MathedIter it(&par->GetData());
 
        while (it.OK() && !(features.binom && features.boldsymbol)) {
                if (it.IsInset()) {