]> git.lyx.org Git - features.git/commitdiff
Save and restore the cursor after a text class switch
authorMartin Vermeer <martin.vermeer@hut.fi>
Fri, 15 Jul 2005 17:45:36 +0000 (17:45 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Fri, 15 Jul 2005 17:45:36 +0000 (17:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10225 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxfunc.C

index 2537f9e595832cb4ed4f041bf51c22aaf3d367b2..dd1793e37d01e4eda565bb246b9541279eb2b7d0 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-15  Juergen Vigna <jug@lyx.org>
+
+       * lyxfunc.C (dispatch): save and restore the cursor after a
+       textclass switch.
+
 2005-07-15    <lgb@tandberg.net>
 
        * text.C (backspace): bug 806 for empty keepempty paragraphs we
index 968d9bd25bd154d2bb4a08acbc02f4ef9fbbc6f6..fc6ef321c0a6ff559f9fa961ac9cfe47da79822f 100644 (file)
@@ -1475,11 +1475,13 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                break;
 
                        owner->message(_("Converting document to new document class..."));
+                       StableDocIterator backcur(view()->cursor());
                        ErrorList el;
                        lyx::cap::SwitchBetweenClasses(
                                old_class, new_class,
                                buffer->paragraphs(), el);
 
+                       view()->setCursor(backcur.asDocIterator(&(buffer->inset())));
                        bufferErrors(*buffer, el);
                        view()->showErrorList(_("Class switch"));
                        updateCounters(*buffer);