mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Add accept/reject change to the edit context menu.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29478 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
61e32e1c25
commit
7108b8e463
@ -292,6 +292,9 @@ Menuset
|
||||
OptItem "Move Section up|u" "outline-up"
|
||||
OptItem "Insert Short Title|T" "optional-insert"
|
||||
Separator
|
||||
OptItem "Accept Change|C" "change-accept"
|
||||
OptItem "Reject Change|R" "change-reject"
|
||||
Separator
|
||||
Item "Apply Last Text Style|A" "textstyle-apply"
|
||||
Submenu "Text Style|S" "edit_textstyles"
|
||||
Item "Paragraph Settings...|P" "layout-paragraph"
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "Language.h"
|
||||
#include "Length.h"
|
||||
#include "Lexer.h"
|
||||
#include "lyxfind.h"
|
||||
#include "LyXRC.h"
|
||||
#include "Paragraph.h"
|
||||
#include "paragraph_funcs.h"
|
||||
@ -792,8 +793,11 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op)
|
||||
{
|
||||
LASSERT(this == cur.text(), /**/);
|
||||
|
||||
if (!cur.selection())
|
||||
if (!cur.selection()) {
|
||||
Change const & change = cur.paragraph().lookupChange(cur.pos());
|
||||
if (!(change.changed() && findNextChange(&cur.bv())))
|
||||
return;
|
||||
}
|
||||
|
||||
cur.recordUndoSelection();
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "buffer_funcs.h"
|
||||
#include "BufferParams.h"
|
||||
#include "BufferView.h"
|
||||
#include "Changes.h"
|
||||
#include "Cursor.h"
|
||||
#include "CutAndPaste.h"
|
||||
#include "DispatchResult.h"
|
||||
@ -2269,12 +2270,17 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
|
||||
case LFUN_CHANGE_ACCEPT:
|
||||
case LFUN_CHANGE_REJECT:
|
||||
// TODO: context-sensitive enabling of LFUN_CHANGE_ACCEPT/REJECT
|
||||
// In principle, these LFUNs should only be enabled if there
|
||||
// is a change at the current position/in the current selection.
|
||||
// However, without proper optimizations, this will inevitably
|
||||
// result in unacceptable performance - just imagine a user who
|
||||
// wants to select the complete content of a long document.
|
||||
if (!cur.selection()) {
|
||||
Change const & change = cur.paragraph().lookupChange(cur.pos());
|
||||
enable = change.changed();
|
||||
} else
|
||||
// TODO: context-sensitive enabling of LFUN_CHANGE_ACCEPT/REJECT
|
||||
// for selections.
|
||||
enable = true;
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user