Use standard comparison against end

This makes it more easy to exchange the underlying iterator. Also, use our
own specialized erase() instead of repeating its implementation.
This commit is contained in:
Georg Baum 2015-03-22 17:29:22 +01:00
parent 880715c5a5
commit 1fb31ab92d

View File

@ -676,7 +676,7 @@ void MathData::attachMacroParameters(Cursor * cur,
}
// remove them from the MathData
erase(begin() + macroPos + 1, begin() + p);
erase(macroPos + 1, p);
// cursor outside this MathData?
if (thisSlice == -1)
@ -883,7 +883,7 @@ MathData::size_type MathData::x2pos(BufferView const * bv, int targetx, int glue
int currx = 0;
CoordCacheBase<Inset> const & coords = bv->coordCache().getInsets();
// find first position after targetx
for (; currx < targetx && it < end(); ++it) {
for (; currx < targetx && it != end(); ++it) {
lastx = currx;
if ((*it)->getChar() == ' ')
currx += glue;