From de263dca11504d50b61c51a06f6e88dce230f172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 23 Feb 2008 17:21:33 +0000 Subject: [PATCH] * src/Text3.cpp (cursorPrevious, cursorNext): - Fix a crash when pressing "page up" while the cursor is in an empty paragraph (bug 4570); patch by Jean-Marc, slightly extended by advice of Abdel. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@23160 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 17 ++++++++++++++--- status.15x | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index 68cbb0655f..15146b3a73 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1,5 +1,5 @@ /** - * \file text3.cpp + * \file Text3.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -204,8 +204,7 @@ void Text::cursorPrevious(Cursor & cur) pos_type cpos = cur.pos(); pit_type cpar = cur.pit(); - int x = cur.x_target(); - setCursorFromCoordinates(cur, x, 0); + setCursorFromCoordinates(cur, cur.x_target(), 0); cur.dispatch(FuncRequest(cur.selection()? LFUN_UP_SELECT: LFUN_UP)); if (cpar == cur.pit() && cpos == cur.pos()) @@ -215,6 +214,12 @@ void Text::cursorPrevious(Cursor & cur) finishUndo(); cur.updateFlags(Update::Force | Update::FitCursor); + /* one of the dispatch calls above may have set the dispatched + * status of the cursor to false. Did I ever say that calling + * cur.dispatch directly is a bad idea? See bug 4570 for a + * possible consequence (JMarc) + */ + cur.dispatched(); } @@ -235,6 +240,12 @@ void Text::cursorNext(Cursor & cur) finishUndo(); cur.updateFlags(Update::Force | Update::FitCursor); + /* one of the dispatch calls above may have set the dispatched + * status of the cursor to false. Did I ever say that calling + * cur.dispatch directly is a bad idea? See bug 4570 for a + * possible consequence (JMarc) + */ + cur.dispatched(); } diff --git a/status.15x b/status.15x index b89402f44e..fa7630eb80 100644 --- a/status.15x +++ b/status.15x @@ -161,6 +161,9 @@ What's new displayed when hovering over a char style had to be disabled for the time being (bug 4559). +- Fix a crash when pressing "page up" while the cursor is in an empty + paragraph (bug 4570). + - Do not exit after catching an iconv exception (bug 4385, part 2). - Fix update/drawing of character style insets.