]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.C
Fix bug 886 and others not reported related with the document paper size.
[lyx.git] / src / cursor.C
index 8e2a117d0108a3ba690799458761b01967fe3482..e54cfe904f94bfe2fd1b9e524060c36de9987b47 100644 (file)
@@ -32,7 +32,6 @@
 #include "paragraph_funcs.h"
 #include "pariterator.h"
 
-#include "insets/updatableinset.h"
 #include "insets/insettabular.h"
 #include "insets/insettext.h"
 
@@ -97,9 +96,7 @@ namespace {
                for (int i = 0; ; ++i) {
                        int xo;
                        int yo;
-                       LCursor cur = c;
-                       cur.setCursor(it);
-                       cur.inset().getCursorPos(cur.top(), xo, yo);
+                       it.inset().cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo);
                        double d = (x - xo) * (x - xo) + (y - yo) * (y - yo);
                        // '<=' in order to take the last possible position
                        // this is important for clicking behind \sum in e.g. '\sum_i a'
@@ -134,7 +131,7 @@ namespace {
                        // avoid invalid nesting when selecting
                        if (bv_funcs::status(&cursor.bv(), it) == bv_funcs::CUR_INSIDE
                            && (!cursor.selection() || positionable(it, cursor.anchor_))) {
-                               Point p = bv_funcs::getPos(it);
+                               Point p = bv_funcs::getPos(it, false);
                                int xo = p.x_;
                                int yo = p.y_;
                                if (xlow <= xo && xo <= xhigh && ylow <= yo && yo <= yhigh) {
@@ -167,7 +164,7 @@ namespace {
 // bv functions are not yet available!
 LCursor::LCursor(BufferView & bv)
        : DocIterator(), bv_(&bv), anchor_(), x_target_(-1),
-         selection_(false), mark_(false)
+         selection_(false), mark_(false), logicalpos_(false)
 {}
 
 
@@ -309,7 +306,7 @@ int LCursor::currentMode()
 
 void LCursor::getPos(int & x, int & y) const
 {
-       Point p = bv_funcs::getPos(*this);
+       Point p = bv_funcs::getPos(*this, boundary());
        x = p.x_;
        y = p.y_;
 }