]> git.lyx.org Git - lyx.git/blobdiff - src/dociterator.C
update build instructions (Qt 4.2.2 etc.)
[lyx.git] / src / dociterator.C
index 7d86f24a5b1d77d0c33eb3a68279489a2643dcdd..bb72fb6c2d71c669dffc61b936fc3a36c9e4beaa 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "debug.h"
 #include "lyxtext.h"
-#include "lyxrow.h"
 #include "paragraph.h"
 
 #include "mathed/MathData.h"
@@ -235,18 +234,6 @@ MathArray & DocIterator::cell()
 }
 
 
-bool DocIterator::inMathed() const
-{
-       return !empty() && inset().inMathed();
-}
-
-
-bool DocIterator::inTexted() const
-{
-       return !empty() && !inset().inMathed();
-}
-
-
 LyXText * DocIterator::innerText()
 {
        BOOST_ASSERT(!empty());
@@ -287,11 +274,12 @@ void DocIterator::forwardPos(bool ignorecollapsed)
                return;
        }
 
+       InsetBase * const nextinset = nextInset();
        // jump over collapsables if they are collapsed
        // FIXME: the check for asInsetMath() shouldn't be necessary
        // but math insets do not return a sensible editable() state yet.
-       if (ignorecollapsed && nextInset() && (!nextInset()->asInsetMath()
-           && nextInset()->editable() != InsetBase::HIGHLY_EDITABLE)) {
+       if (ignorecollapsed && nextinset && (!nextinset->asInsetMath()
+           && nextinset->editable() != InsetBase::HIGHLY_EDITABLE)) {
                ++top().pos();
                return;
        }
@@ -405,8 +393,11 @@ void DocIterator::forwardPar()
                        pos_type const lastp = lastpos();
                        Paragraph const & par = paragraph();
                        pos_type & pos = top().pos();
-                       while (pos < lastp && !par.isInset(pos))
-                               ++pos;
+                       if (par.insetlist.empty())
+                               pos = lastp;
+                       else
+                               while (pos < lastp && !par.isInset(pos))
+                                       ++pos;
                }
                forwardPos();
        }