Cleanup: Rename textUndo to undoAction

This is not limited to text, but also handles math.

Same change to textRedo.
This commit is contained in:
Jean-Marc Lasgouttes 2018-08-26 16:47:25 +02:00
parent dd8fd3d90a
commit 86398b5d91
5 changed files with 19 additions and 19 deletions

View File

@ -1397,7 +1397,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// So these should not be references...
string const engine = buffer().params().citeEngine();
CiteEngineType const enginetype = buffer().params().citeEngineType();
if (!cur.textUndo())
if (!cur.undoAction())
dr.setMessage(_("No further undo information"));
else {
dr.screenUpdate(Update::Force | Update::FitCursor);
@ -1417,7 +1417,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// So these should not be references...
string const engine = buffer().params().citeEngine();
CiteEngineType const enginetype = buffer().params().citeEngineType();
if (!cur.textRedo())
if (!cur.redoAction())
dr.setMessage(_("No further redo information"));
else {
dr.screenUpdate(Update::Force | Update::FitCursor);

View File

@ -591,18 +591,18 @@ void CursorData::leaveInset(Inset const & inset)
}
bool CursorData::textUndo()
bool CursorData::undoAction()
{
if (!buffer()->undo().textUndo(*this))
if (!buffer()->undo().undoAction(*this))
return false;
sanitize();
return true;
}
bool CursorData::textRedo()
bool CursorData::redoAction()
{
if (!buffer()->undo().textRedo(*this))
if (!buffer()->undo().redoAction(*this))
return false;
sanitize();
return true;

View File

@ -177,9 +177,9 @@ public:
void leaveInset(Inset const & inset);
///
bool textUndo();
bool undoAction();
///
bool textRedo();
bool redoAction();
/// makes sure the next operation will be stored
void finishUndo() const;

View File

@ -203,10 +203,10 @@ struct Undo::Private
group_id_(0), group_level_(0) {}
// Do one undo/redo step
void doTextUndoOrRedo(CursorData & cur, UndoElementStack & stack,
void doUndoRedoAction(CursorData & cur, UndoElementStack & stack,
UndoElementStack & otherStack);
// Apply one undo/redo group. Returns false if no undo possible.
bool textUndoOrRedo(CursorData & cur, bool isUndoOperation);
bool undoRedoAction(CursorData & cur, bool isUndoOperation);
///
void doRecordUndo(UndoKind kind,
@ -430,7 +430,7 @@ void Undo::Private::recordUndoBufferParams(CursorData const & cur)
}
void Undo::Private::doTextUndoOrRedo(CursorData & cur, UndoElementStack & stack, UndoElementStack & otherstack)
void Undo::Private::doUndoRedoAction(CursorData & cur, UndoElementStack & stack, UndoElementStack & otherstack)
{
// Adjust undo stack and get hold of current undo data.
UndoElement & undo = stack.top();
@ -528,7 +528,7 @@ void Undo::Private::doTextUndoOrRedo(CursorData & cur, UndoElementStack & stack,
}
bool Undo::Private::textUndoOrRedo(CursorData & cur, bool isUndoOperation)
bool Undo::Private::undoRedoAction(CursorData & cur, bool isUndoOperation)
{
undo_finished_ = true;
@ -542,7 +542,7 @@ bool Undo::Private::textUndoOrRedo(CursorData & cur, bool isUndoOperation)
const size_t gid = stack.top().group_id;
while (!stack.empty() && stack.top().group_id == gid)
doTextUndoOrRedo(cur, stack, otherstack);
doUndoRedoAction(cur, stack, otherstack);
return true;
}
@ -554,15 +554,15 @@ void Undo::finishUndo()
}
bool Undo::textUndo(CursorData & cur)
bool Undo::undoAction(CursorData & cur)
{
return d->textUndoOrRedo(cur, true);
return d->undoRedoAction(cur, true);
}
bool Undo::textRedo(CursorData & cur)
bool Undo::redoAction(CursorData & cur)
{
return d->textUndoOrRedo(cur, false);
return d->undoRedoAction(cur, false);
}

View File

@ -60,10 +60,10 @@ public:
void clear();
/// this will undo the last action - returns false if no undo possible
bool textUndo(CursorData &);
bool undoAction(CursorData &);
/// this will redo the last undo - returns false if no redo possible
bool textRedo(CursorData &);
bool redoAction(CursorData &);
/// End a sequence of INSERT_UNDO or DELETE_UNDO type of undo
/// operations (grouping of consecutive characters insertion/deletion).