A small one... -- André Pönitz ........................................ [EMAIL PROTECTED]
Index: array.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/array.C,v retrieving revision 1.11 diff -u -p -r1.11 array.C --- array.C 2001/02/20 13:16:07 1.11 +++ array.C 2001/02/20 18:20:07 @@ -219,9 +219,9 @@ void MathedArray::insert(MathedArray::it 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: array.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/array.h,v retrieving revision 1.18 diff -u -p -r1.18 array.h --- array.h 2001/02/20 13:16:07 1.18 +++ array.h 2001/02/20 18:20:07 @@ -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: math_cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_cursor.C,v retrieving revision 1.38 diff -u -p -r1.38 math_cursor.C --- math_cursor.C 2001/02/20 16:00:22 1.38 +++ math_cursor.C 2001/02/20 18:20:07 @@ -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: math_xiter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xiter.C,v retrieving revision 1.11 diff -u -p -r1.11 math_xiter.C --- math_xiter.C 2001/02/20 16:00:22 1.11 +++ math_xiter.C 2001/02/20 18:20:07 @@ -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: math_xiter.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_xiter.h,v retrieving revision 1.7 diff -u -p -r1.7 math_xiter.h --- math_xiter.h 2001/02/17 18:52:53 1.7 +++ math_xiter.h 2001/02/20 18:20:07 @@ -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); ///