* 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
This commit is contained in:
Jürgen Spitzmüller 2007-11-06 14:39:30 +00:00
parent 452d7e28c0
commit 382db53914
3 changed files with 36 additions and 25 deletions

View File

@ -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;

View File

@ -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:

View File

@ -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).