]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_parinset.C
mathed31.diff
[lyx.git] / src / mathed / math_parinset.C
index 2ca3d14a092101296a04a7769d87f2810c1350d0..862f4554d043422a35f06192bb8fd51f80146bf1 100644 (file)
@@ -35,16 +35,6 @@ MathParInset::MathParInset(short st, string const & nm, short ot)
 }
 
 
-MathParInset::MathParInset(MathParInset * p)
-       : MathedInset(p)
-{
-       flag = p->flag;
-       p->setArgumentIdx(0);
-       MathedIter it(p->GetData());
-       setData(it.Copy());
-}
-
-
 MathParInset::~MathParInset()
 {
 }
@@ -52,12 +42,18 @@ MathParInset::~MathParInset()
 
 MathedInset * MathParInset::Clone()
 {
-       return new MathParInset(this);
+       return new MathParInset(*this);
 }
 
 
 void MathParInset::setData(MathedArray * a)
 {
+       if (!a) {
+               lyxerr << "can't set Data from NULL pointer" << endl;
+               array = MathedArray();
+               return;
+       }
+
        array = *a;
        
        // A standard paragraph shouldn't have any tabs nor CRs.
@@ -387,6 +383,11 @@ void MathParInset::Write(ostream & os, bool fragile)
 }
 
 
+void MathParInset::clear()
+{
+       array.clear();
+}
+
 bool MathParInset::Inside(int x, int y) 
 {
   return (x >= xo() && x <= xo() + width