]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.cpp
Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
[lyx.git] / src / bufferview_funcs.cpp
index 6c218eb53e964d3a2b49eb31278cb623e5d85bfd..4aa848d511767dadded2852865069ba6c0c3f24b 100644 (file)
@@ -245,13 +245,15 @@ Point getPos(BufferView const & bv, DocIterator const & dit, bool boundary)
 // FIXME: This does not work within mathed!
 CurStatus status(BufferView const * bv, DocIterator const & dit)
 {
+       // FIXME: it's be better to have something like TextMetrics::status().
        TextMetrics const & tm = bv->textMetrics(dit.bottom().text());
-       if (tm.has(dit.bottom().pit()))
-               return CUR_INSIDE;
-       else if (dit.bottom().pit() < bv->anchor_ref())
+       int par_pos = tm.parPosition(dit.bottom().pit());
+       if (par_pos < 0)
                return CUR_ABOVE;
-       else
+       else if (par_pos > bv->workHeight())
                return CUR_BELOW;
+               
+       return CUR_INSIDE;
 }
 
 namespace {