commit 82263ccad98dba35f1f4527a8ed72ea24a60e0bd
Author: Georg Baum <[email protected]>
Date:   Thu Mar 19 21:44:25 2015 +0100

    Implement DocIterator::backwardInset()
    
    I thought I would need it to fix bug #9418, but once backwardInset() worked
    it turned out that it is not needed. However, since it took me some time to
    figure out the correct implementation I do not want to throw the result 
away.

diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp
index e574115..750479f 100644
--- a/src/DocIterator.cpp
+++ b/src/DocIterator.cpp
@@ -449,6 +449,28 @@ void DocIterator::backwardPos()
 }
 
 
+#if 0
+// works, but currently not needed
+void DocIterator::backwardInset()
+{
+       backwardPos();
+
+       while (!empty() && !nextInset()) {
+               if (inTexted()) {
+                       pos_type const lastp = lastpos();
+                       Paragraph const & par = paragraph();
+                       pos_type & pos = top().pos();
+                       while (pos > 0 && (pos == lastp || !par.isInset(pos)))
+                               --pos;
+                       if (pos > 0)
+                               break;
+               }
+               backwardPos();
+       }
+}
+#endif
+
+
 bool DocIterator::hasPart(DocIterator const & it) const
 {
        // it can't be a part if it is larger
diff --git a/src/DocIterator.h b/src/DocIterator.h
index 7796819..6a86e41 100644
--- a/src/DocIterator.h
+++ b/src/DocIterator.h
@@ -202,7 +202,7 @@ public:
        /// move backward one paragraph
        void backwardPar();
        /// move backward one inset
-       /// FIXME: This is not implemented!
+       /// not used currently, uncomment if you need it
        //void backwardInset();
 
        /// are we some 'extension' (i.e. deeper nested) of the given iterator

Reply via email to