]> git.lyx.org Git - features.git/commitdiff
mathed35.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 20 Feb 2001 18:32:18 +0000 (18:32 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 20 Feb 2001 18:32:18 +0000 (18:32 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1580 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/array.C
src/mathed/array.h
src/mathed/math_cursor.C
src/mathed/math_xiter.C
src/mathed/math_xiter.h

index 80568195631219050d9c052c31d141efc7f83fa7..eba96ab49546616a7ac21e63d35352959502626b 100644 (file)
@@ -219,9 +219,9 @@ void MathedArray::insert(MathedArray::iterator pos,
        last_ = bf_.size() - 1;
 }
 #else
-void MathedArray::mergeF(MathedArray * a, int p, int dx)
+void MathedArray::merge(MathedArray const & a, int p)
 {
-       my_memcpy(&bf_[p], &a->bf_[0], dx);
+       my_memcpy(&bf_[p], &a.bf_[0], a.last());
 }
 #endif
 
index 1d19613f1f7e4366906ee46d67a96db758f92c24..35b205fb7dcc7f56b3f5ab7d6b4ef9c9b7b04788 100644 (file)
@@ -84,7 +84,7 @@ public:
 #else
        /// Merge \a dx elements from array \a a at \apos.
        /// This doesn't changes the size (dangerous)
-       void mergeF(MathedArray * a, int pos, int dx); 
+       void merge(MathedArray const & a, int pos); 
 #endif
        ///
        void raw_pointer_copy(MathedInset ** p, int pos) const;
index e547399f65b85437c3990ed72131b6407731c25a..68d583db38090ea5a75e7c362b89cf6280377295 100644 (file)
@@ -844,7 +844,7 @@ bool MathedCursor::pullArg()
                p->clear();
                Delete();
                if (!a.empty()) {
-                       cursor->Merge(&a);
+                       cursor->Merge(a);
                        cursor->Adjust();
                }
 
@@ -947,7 +947,7 @@ void MathedCursor::SelPaste()
                SelDel();
 
        if (!selarray.empty()) {
-               cursor->Merge(&selarray);
+               cursor->Merge(selarray);
                cursor->Adjust();
        }
 }
index 860dfe89a80ca6f72c61eb633b6f1aaee898f7bb..e14cc4c3e8de3e006eabf6f99147495718abecdb 100644 (file)
@@ -139,27 +139,18 @@ void MathedXIter::Clean(int pos2)
 }
 
 
-void MathedXIter::Merge(MathedArray * a0)
+void MathedXIter::Merge(MathedArray const & a)
 {
-       if (!a0) {
-               lyxerr[Debug::MATHED]
-                       << "Math error: Attempting to merge a void array." << endl;
-               
-               return;
-       }
-       // All insets must be clonned
-       MathedArray * a = new MathedArray(*a0);
-
 #if 0
        array->insert(array->begin() + pos,
-                     a->begin(), a->end());
+                     a.begin(), a.end());
 #else
        // make room for the data 
-       split(a->last());
-       array->mergeF(a, pos, a->last());
+       split(a.last());
+       array->merge(a, pos);
 #endif
        int pos1 = pos;
-       int pos2 = pos + a->last();
+       int pos2 = pos + a.last();
        
        goPosAbs(pos1);
        
@@ -186,8 +177,6 @@ void MathedXIter::Merge(MathedArray * a0)
        goPosAbs(pos1);
        checkTabs();
        goPosAbs(pos2);
-       
-       delete a;
 }
 
 
index 6a15654e3dcbd0afc40a065f23d347847be581bc..0999b8f311eda151a75ac271c3e3322dcdc09317 100644 (file)
@@ -71,7 +71,7 @@ public:
        ///
        void setTab(int, int);
        /// Merge the array at current position
-       void Merge(MathedArray *);
+       void Merge(MathedArray const &);
        /// Delete every object from current position to pos2
        void Clean(int pos2);
        ///