commit 86398b5d9135b05d368a0a4af45510d6d0827ac0
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Sun Aug 26 16:47:25 2018 +0200

    Cleanup: Rename textUndo to undoAction
    
    This is not limited to text, but also handles math.
    
    Same change to textRedo.
---
 src/BufferView.cpp |    4 ++--
 src/Cursor.cpp     |    8 ++++----
 src/Cursor.h       |    4 ++--
 src/Undo.cpp       |   18 +++++++++---------
 src/Undo.h         |    4 ++--
 5 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index a3d0804..7bdf9f3 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -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);
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index b78c1f5..ef9b837 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -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;
diff --git a/src/Cursor.h b/src/Cursor.h
index 3c132e0..dcce849 100644
--- a/src/Cursor.h
+++ b/src/Cursor.h
@@ -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;
diff --git a/src/Undo.cpp b/src/Undo.cpp
index 6930082..5d613f2 100644
--- a/src/Undo.cpp
+++ b/src/Undo.cpp
@@ -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);
 }
 
 
diff --git a/src/Undo.h b/src/Undo.h
index 6f6cca6..dd70358 100644
--- a/src/Undo.h
+++ b/src/Undo.h
@@ -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).

Reply via email to