]> git.lyx.org Git - features.git/commitdiff
Use standard comparison against end
authorGeorg Baum <baum@lyx.org>
Sun, 22 Mar 2015 16:29:22 +0000 (17:29 +0100)
committerGeorg Baum <baum@lyx.org>
Sun, 22 Mar 2015 16:31:55 +0000 (17:31 +0100)
This makes it more easy to exchange the underlying iterator. Also, use our
own specialized erase() instead of repeating its implementation.

src/mathed/MathData.cpp

index 1b79f0cb9a72588b20712826d1dea6f0d77af543..2d5bcd02afc621b8690277738f92a82d22717e43 100644 (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;