]> git.lyx.org Git - lyx.git/blobdiff - src/text2.C
do not create invalid .lyx files when importing \i{}, \j{}, \l{} or \L{}.
[lyx.git] / src / text2.C
index d1399ebd911c7315863efe61fed764b2c05462c3..0947c0303bfd62aa3b3458d2f19deec71822c39f 100644 (file)
@@ -915,7 +915,6 @@ pit_type LyXText::getPitNearY(BufferView & bv, int y)
                << endl;
 
        // look for highest numbered paragraph with y coordinate less than given y
-       bool found = false;
        pit_type pit = 0;
        int yy = -1;
        CoordCache::InnerParPosCache::const_iterator it = cc.begin();
@@ -945,7 +944,7 @@ pit_type LyXText::getPitNearY(BufferView & bv, int y)
                pit = last->first + 1;
                //  and we are not at the last paragraph in the inset.
                if (pit == pars_.size())
-                       return it->first;
+                       return last->first;
                // then this is the paragraph we are looking for.
                // rebreak it and update the CoordCache.
                redoParagraph(bv, pit);