]> git.lyx.org Git - features.git/commitdiff
mathed50.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 8 Mar 2001 22:19:55 +0000 (22:19 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 8 Mar 2001 22:19:55 +0000 (22:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1719 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_matrixinset.C
src/mathed/math_matrixinset.h
src/mathed/math_rowst.h

index 86046e7be04b73ec2dbd715776078b01bd463e06..bf4db3ce13e5cd0ae70dae3e0b8aae35765d6e54 100644 (file)
@@ -3,6 +3,12 @@
 
        * math_xiter.C: new 'container()' method to encapsulated access to
          the MathParInset's MathedRowContainer
+
+       * math_rowst.h: proper copy constructor and destructor for
+         MathedRowContainer
+
+       * math_matrixinset.[hC]: remove copy constructr and destructor. Those
+         automatically created by the compiler are ok now.
        
 2001-03-06  André Pönitz  <poenitz@htwm.de>
        * array.[Ch]: factor out deep_copy,
index cd9d291a3117b7d80213300bf201ade0ce9a2e37..30842ab21a3c14f3a19f6f4fece160d14010e6d1 100644 (file)
@@ -35,47 +35,6 @@ MathMatrixInset::MathMatrixInset(int m, int n, short st)
 }
 
 
-MathMatrixInset::MathMatrixInset(MathMatrixInset const & mt)
-       : MathParInset(mt.GetStyle(), mt.GetName(), mt.GetType()),
-         nc_(mt.nc_), nr_(0), ws_(mt.nc_),
-         v_align_(mt.v_align_), h_align_(mt.h_align_)
-{
-       array = mt.GetData();
-       if (!mt.row_.empty()) {
-               MathedRowSt * ro = 0;
-               MathedRowSt * mrow = mt.row_.data_;
-
-               while (mrow) {
-                       MathedRowSt * r = new MathedRowSt(nc_ + 1);
-                       r->setNumbered(mrow->isNumbered());
-                       //if (mrow->label) 
-                       r->setLabel(mrow->getLabel());
-                       if (!ro) 
-                               row_.data_ = r;
-                       else
-                               ro->next_ = r;
-                       mrow = mrow->next_;
-                       ro = r;
-                       ++nr_;
-               }
-       } else   
-               row_.data_ = 0;
-       flag = mt.flag;
-}
-
-
-MathMatrixInset::~MathMatrixInset()
-{
-       MathedRowSt * r = row_.data_;
-       while (r) {
-               MathedRowSt * q = r->next_;
-               delete r;
-               r = q;
-       }
-}
-
-
-
 MathedInset * MathMatrixInset::Clone()
 {
        return new MathMatrixInset(*this);
index 8561d72a3b5dd6ebb17468087281c692da0732cf..a3f59639790d90e6c25def6953956cac4d4ca953 100644 (file)
 class MathMatrixInset : public MathParInset {
 public: 
        ///
-       explicit
        MathMatrixInset(int m, int n, short st = LM_ST_TEXT);
        ///
-       explicit
-       MathMatrixInset(MathMatrixInset const &);
-       ///
-       ~MathMatrixInset();
-       ///
        MathedInset * Clone();
        ///
        void draw(Painter &, int, int);
index 488967e4faa4b7f1461a11847b45f76ce511d2bc..ea6c16d0377c9042c2a7cb339f3ed051ed27a4d9 100644 (file)
@@ -116,6 +116,34 @@ struct MathedRowContainer {
        ///
        MathedRowContainer() : data_(0) {}
 
+       ///
+       MathedRowContainer(MathedRowContainer const & c) : data_(0) {
+               if (!c.empty()) {
+                       MathedRowSt * ro = 0;
+                       MathedRowSt * mrow = c.data_;
+
+                       while (mrow) {
+                               MathedRowSt * r = new MathedRowSt(*mrow);
+                               if (!ro) 
+                                       data_ = r;
+                               else
+                                       ro->next_ = r;
+                               mrow = mrow->next_;
+                               ro = r;
+                       }
+               }
+       }
+
+               
+       ~MathedRowContainer() {
+               MathedRowSt * r = data_;
+               while (r) {
+                       MathedRowSt * q = r->next_;
+                       delete r;
+                       r = q;
+               }
+       }
+
        ///
        iterator begin() { return iterator(this); }
        ///
@@ -151,7 +179,6 @@ struct MathedRowContainer {
 
 private:
        // currently unimplemented just to make sure it's not used
-       MathedRowContainer(MathedRowContainer const &); // unimplemented
        void operator=(MathedRowContainer const &); // unimplemented
 };