From 382db53914fd6f7778b18418d51a3e95a491e73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 6 Nov 2007 14:39:30 +0000 Subject: [PATCH] * src/BufferView.cpp: - move the LFUN_OUTLINE_*'s out of here ... * src/Text3.cpp: - to this place. This fixes a crash (bug 4330). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@21473 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferView.cpp | 25 ------------------------- src/Text3.cpp | 34 ++++++++++++++++++++++++++++++++++ status.15x | 2 ++ 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index d147cc441a..c79ec0804b 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -49,7 +49,6 @@ #include "ParagraphParameters.h" #include "ParIterator.h" #include "TexRow.h" -#include "toc.h" #include "Undo.h" #include "VSpace.h" #include "WordLangTuple.h" @@ -645,11 +644,6 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd) case LFUN_FONT_STATE: case LFUN_LABEL_INSERT: case LFUN_PARAGRAPH_GOTO: - // FIXME handle non-trivially - case LFUN_OUTLINE_UP: - case LFUN_OUTLINE_DOWN: - case LFUN_OUTLINE_IN: - case LFUN_OUTLINE_OUT: case LFUN_NOTE_NEXT: case LFUN_REFERENCE_NEXT: case LFUN_WORD_FIND: @@ -820,25 +814,6 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) break; } - case LFUN_OUTLINE_UP: - toc::outline(toc::Up, cursor_); - cursor_.text()->setCursor(cursor_, cursor_.pit(), 0); - updateLabels(*buffer_); - break; - case LFUN_OUTLINE_DOWN: - toc::outline(toc::Down, cursor_); - cursor_.text()->setCursor(cursor_, cursor_.pit(), 0); - updateLabels(*buffer_); - break; - case LFUN_OUTLINE_IN: - toc::outline(toc::In, cursor_); - updateLabels(*buffer_); - break; - case LFUN_OUTLINE_OUT: - toc::outline(toc::Out, cursor_); - updateLabels(*buffer_); - break; - case LFUN_NOTE_NEXT: bv_funcs::gotoInset(this, Inset::NOTE_CODE, false); break; diff --git a/src/Text3.cpp b/src/Text3.cpp index 5eb542098e..b9d6c591fd 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -44,6 +44,7 @@ #include "Paragraph.h" #include "paragraph_funcs.h" #include "ParagraphParameters.h" +#include "toc.h" #include "Undo.h" #include "VSpace.h" #include "ParIterator.h" @@ -1605,6 +1606,32 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } break; + case LFUN_OUTLINE_UP: + toc::outline(toc::Up, cur); + setCursor(cur, cur.pit(), 0); + updateLabels(cur.buffer()); + needsUpdate = true; + break; + + case LFUN_OUTLINE_DOWN: + toc::outline(toc::Down, cur); + setCursor(cur, cur.pit(), 0); + updateLabels(cur.buffer()); + needsUpdate = true; + break; + + case LFUN_OUTLINE_IN: + toc::outline(toc::In, cur); + updateLabels(cur.buffer()); + needsUpdate = true; + break; + + case LFUN_OUTLINE_OUT: + toc::outline(toc::Out, cur); + updateLabels(cur.buffer()); + needsUpdate = true; + break; + default: LYXERR(Debug::ACTION) << BOOST_CURRENT_FUNCTION @@ -1919,6 +1946,13 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, enable = true; break; + case LFUN_OUTLINE_UP: + case LFUN_OUTLINE_DOWN: + case LFUN_OUTLINE_IN: + case LFUN_OUTLINE_OUT: + enable = (cur.paragraph().layout()->toclevel != Layout::NOT_IN_TOC); + break; + case LFUN_WORD_DELETE_FORWARD: case LFUN_WORD_DELETE_BACKWARD: case LFUN_LINE_DELETE: diff --git a/status.15x b/status.15x index 3b4927b59a..15c51a8e9b 100644 --- a/status.15x +++ b/status.15x @@ -87,6 +87,8 @@ What's new - Fix a crash when deleting a row or column of a math matrix while its content is selected (bug 4323). +- Fix a crash when using the outline-* lfuns within mathed (bug 4330). + - Fix a crash when overwriting a selection that spans multiple paragraphs (bug 4317).