/// just selects the word the cursor is in
void selectWord(LCursor & cur, word_location loc);
- /// accept selected change
- void acceptChange(LCursor & cur);
- /// reject selected change
- void rejectChange(LCursor & cur);
+ /// what type of change operation to make
+ enum ChangeOp {
+ ACCEPT,
+ REJECT
+ };
+ /// accept or reject the selected change
+ void acceptOrRejectChanges(LCursor & cur, ChangeOp op);
+ /// accept the changes within the complete LyXText
+ void acceptChanges(BufferParams const & bparams);
+ /// reject the changes within the complete LyXText
+ void rejectChanges(BufferParams const & bparams);
/// returns true if par was empty and was removed
bool setCursor(LCursor & cur, pit_type par, pos_type pos,
int cursorY(BufferView const & bv, CursorSlice const & cursor,
bool boundary) const;
- /// delete double space or empty paragraphs around old cursor.
+ /// delete double spaces, leading spaces, and empty paragraphs around old cursor.
/// \retval true if a change has happened and we need a redraw.
/// FIXME: replace LCursor with DocIterator. This is not possible right
/// now because recordUndo() is called which needs a LCursor.
- bool deleteEmptyParagraphMechanism(LCursor & cur,
+ static bool deleteEmptyParagraphMechanism(LCursor & cur,
LCursor & old, bool & need_anchor_change);
+ /// delete double spaces, leading spaces, and empty paragraphs
+ /// from \first to \last paragraph
+ void deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges);
+
public:
/// the current font settings
LyXFont current_font;
// fix the cursor `cur' after a characters has been deleted at `where'
// position. Called by deleteEmptyParagraphMechanism
- void fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where);
+ static void fixCursorAfterDelete(CursorSlice & cur, CursorSlice const & where);
// At cursor position 0, try to merge the paragraph with the one before it.
// Ignore change tracking, i.e., physically remove the end-of-par character