}
-bool MathArray::next(int & pos) const
-{
- if (pos >= size() - 1)
- return false;
-
- ++pos;
- return true;
-}
-
-
int MathArray::last() const
{
return size() - 1;
MathTextCodes const fcode = getCode(pos);
do {
s += getChar(pos);
- next(pos);
+ ++pos;
} while (pos < size() && !isInset(pos) && getCode(pos) == fcode);
return s;
void MathArray::erase(int pos)
{
if (pos < size())
- bf_.erase(bf_.begin() + pos);
+ erase(pos, pos + 1);
}
void MathArray::erase(int pos1, int pos2)
{
for (int pos = pos1; pos < pos2; ++pos)
- delete nextInset(pos);
+ delete bf_[pos];
bf_.erase(bf_.begin() + pos1, bf_.begin() + pos2);
}