]> git.lyx.org Git - features.git/blobdiff - src/Cursor.h
Generalise the deletion protection mechanism from math to text (#9540)
[features.git] / src / Cursor.h
index f5f1322ce87554e5ee1993f0bf8ae66dc2062fed..dbdd1569b8d577fbc9e5b44b5a8e92eddeca6268 100644 (file)
@@ -232,10 +232,6 @@ public:
        //
        // common part
        //
-       /// move one step backwards
-       bool posBackward();
-       /// move one step forward
-       bool posForward();
        /// move visually one step to the right
        /**
         * @note: This method may move into an inset unless skip_inset == true.
@@ -398,6 +394,11 @@ public:
        /// and after leaving the word the result is empty.
        DocIterator newWord() const { return new_word_; }
 
+       /// Return true if the next or previous inset has confirmDeletion depending
+       /// on the boolean before. If there is a selection, return true if at least
+       /// one inset in the selection has confirmDeletion.
+       bool confirmDeletion(bool before = false) const;
+
 public:
 //private:
        
@@ -454,9 +455,10 @@ public:
        ///
        void insert(MathData const &);
        /// return false for empty math insets
-       bool erase();
-       /// return false for empty math insets
-       bool backspace();
+       /// Use force to skip the confirmDeletion check.
+       bool erase(bool force = false);
+       bool backspace(bool force = false);
+
        /// move the cursor up by sending an internal LFUN_UP
        /// return true if fullscreen update is needed
        bool up();