]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.cpp
Whitespace.
[lyx.git] / src / bufferview_funcs.cpp
index e8c3eff286ef527150525a3012ca6edecb07cb11..d777ac725bec25555374af1987c2ab87782eeca5 100644 (file)
@@ -247,18 +247,10 @@ 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());
-       pit_type const pit = dit.bottom().pit();
-       if (!tm.has(pit)) {
-               if (dit.bottom().pit() < bv->anchor_ref())
-                       return CUR_ABOVE;
-               else
-                       return CUR_BELOW;
-       }
-
-       ParagraphMetrics const & pm = tm.parMetrics(pit);
-       if (pm.position() < 0)
+       int par_pos = tm.parPosition(dit.bottom().pit());
+       if (par_pos < 0)
                return CUR_ABOVE;
-       else if (pm.position() > bv->workHeight())
+       else if (par_pos > bv->workHeight())
                return CUR_BELOW;
                
        return CUR_INSIDE;
@@ -277,7 +269,7 @@ bool findNextInset(DocIterator & dit,
                if (inset
                    && find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end()
                    && (contents.empty() ||
-                       static_cast<InsetCommand const *>(inset)->getContents() == contents)) {
+                   static_cast<InsetCommand const *>(inset)->getContents() == contents)) {
                        dit = tmpdit;
                        return true;
                }