MathArray::~MathArray()
{
for (int pos = 0; pos < size(); next(pos))
- if (MathIsInset(pos))
+ if (isInset(pos))
delete nextInset(pos);
}
replace(pos, nextInset(pos)->clone());
}
+MathArray::MathArray(MathArray const & array, int from, int to)
+ : bf_(array.bf_.begin() + from, array.bf_.begin() + to)
+{
+ for (int pos = 0; pos < size(); next(pos))
+ if (isInset(pos))
+ replace(pos, nextInset(pos)->clone());
+}
+
bool MathArray::next(int & pos) const
{
}
+void MathArray::erase()
+{
+ erase(0, size());
+}
+
+
void MathArray::erase(int pos)
{
if (pos < static_cast<int>(bf_.size()))
{
if (pos >= size())
return false;
- return MathIsInset(bf_[pos]);
+ return MathIsInset(static_cast<MathTextCodes>(bf_[pos]));
}