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
#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;
p->clear();
Delete();
if (!a.empty()) {
- cursor->Merge(&a);
+ cursor->Merge(a);
cursor->Adjust();
}
SelDel();
if (!selarray.empty()) {
- cursor->Merge(&selarray);
+ cursor->Merge(selarray);
cursor->Adjust();
}
}
}
-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);
goPosAbs(pos1);
checkTabs();
goPosAbs(pos2);
-
- delete a;
}
///
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);
///