]> git.lyx.org Git - features.git/commitdiff
Make sure that inset-forall does not skip insets
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 23 Jan 2013 22:02:05 +0000 (23:02 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 6 Feb 2013 09:35:41 +0000 (10:35 +0100)
This could happen with
  inset-forall Note:Note char-delete-forward
when there where consecutive note insets.

src/BufferView.cpp
status.20x

index 057fe0bb32199be516d99812ab2b9cbb3794a60b..d490fe756a4ec3686b73b8c05460a749f05da236 100644 (file)
@@ -1778,7 +1778,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        cur.forwardInset();
                cur.beginUndoGroup();
                while(cur && iterations < max_iter) {
-                       Inset * ins = cur.nextInset();
+                       Inset * const ins = cur.nextInset();
                        if (!ins)
                                break;
                        docstring insname = ins->layoutName();
@@ -1794,7 +1794,9 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                                        break;
                                insname = insname.substr(0, i);
                        }
-                       cur.forwardInset();
+                       // if we did not delete the inset, skip it
+                       if (!cur.nextInset() || cur.nextInset() == ins)
+                               cur.forwardInset();
                }
                cur.endUndoGroup();
                cur = savecur;
index abf1cc737f18a79bc88294291ce2bf5938306089..3cafc49cea17835a7a01fabb93fe1e3c2f6fb3aa 100644 (file)
@@ -124,6 +124,8 @@ What's new
 
 - Do not crop wide characters in Symbols dialog (bug 5707).
 
+- Make sure that inset-forall does not skip insets.
+
 
 * DOCUMENTATION AND LOCALIZATION