mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
* src/BufferView.C: make accept/reject-all-changes atomic operations (also fixes a crash)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17003 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b5787f6112
commit
5ffb6cfbe2
@ -878,25 +878,24 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
|
|||||||
showDialog("changes");
|
showDialog("changes");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_ALL_CHANGES_ACCEPT: {
|
case LFUN_ALL_CHANGES_ACCEPT:
|
||||||
|
// select complete document
|
||||||
cursor_.reset(buffer_->inset());
|
cursor_.reset(buffer_->inset());
|
||||||
#ifdef WITH_WARNINGS
|
cursor_.selHandle(true);
|
||||||
#warning FIXME changes
|
buffer_->text().cursorBottom(cursor_);
|
||||||
#endif
|
// accept everything in a single step to support atomic undo
|
||||||
while (findNextChange(this))
|
buffer_->text().acceptOrRejectChanges(cursor_, LyXText::ACCEPT);
|
||||||
getLyXText()->acceptOrRejectChanges(cursor_, LyXText::ACCEPT);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case LFUN_ALL_CHANGES_REJECT: {
|
case LFUN_ALL_CHANGES_REJECT:
|
||||||
|
// select complete document
|
||||||
cursor_.reset(buffer_->inset());
|
cursor_.reset(buffer_->inset());
|
||||||
#ifdef WITH_WARNINGS
|
cursor_.selHandle(true);
|
||||||
#warning FIXME changes
|
buffer_->text().cursorBottom(cursor_);
|
||||||
#endif
|
// reject everything in a single step to support atomic undo
|
||||||
while (findNextChange(this))
|
// Note: reject does not work recursively; the user may have to repeat the operation
|
||||||
getLyXText()->acceptOrRejectChanges(cursor_, LyXText::REJECT);
|
buffer_->text().acceptOrRejectChanges(cursor_, LyXText::REJECT);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case LFUN_WORD_FIND:
|
case LFUN_WORD_FIND:
|
||||||
find(this, cmd);
|
find(this, cmd);
|
||||||
|
Loading…
Reference in New Issue
Block a user