From f8089470221c7bb9550e37456b8a83544b54a629 Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Fri, 15 Jul 2005 17:45:36 +0000 Subject: [PATCH] Save and restore the cursor after a text class switch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10225 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/lyxfunc.C | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 2537f9e595..dd1793e37d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-07-15 Juergen Vigna + + * lyxfunc.C (dispatch): save and restore the cursor after a + textclass switch. + 2005-07-15 * text.C (backspace): bug 806 for empty keepempty paragraphs we diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 968d9bd25b..fc6ef321c0 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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);