]> git.lyx.org Git - features.git/commitdiff
fix pullArg when pressing <Delete> at the end of an cell
authorAndré Pönitz <poenitz@gmx.net>
Mon, 23 Jul 2001 14:15:14 +0000 (14:15 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 23 Jul 2001 14:15:14 +0000 (14:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2308 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/formulabase.C
src/mathed/math_cursor.C
src/mathed/math_cursor.h

index 3d1d4944002fdc790d1ece70f89c2a3e08b5c0d7..47b464380b0a32f36848c3b0b37a29c5ee232919 100644 (file)
@@ -1,12 +1,16 @@
+2001-07-22  André Pönitz  <poenitz@gmx.net>
+
+       * math_cursor.C: fix "pullArg" behaviour
+
 2001-07-22  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * formula.C (insetAllowed): allow insertion of label
 
-2001-07-20 André Pönitz  <poenitz@htwm.de>
+2001-07-20 André Pönitz  <poenitz@gmx.net>
 
        * math_macrotable.C: support for \land and \vee
 
-2001-07-16 André Pönitz  <poenitz@htwm.de>
+2001-07-16 André Pönitz  <poenitz@gmx.net>
 
        * math_grid.[Ch] -> math_gridinset.[Ch]
          math_root.[Ch] -> math_rootinset.[Ch]: more consistent names
@@ -20,7 +24,7 @@
        (operator<): ditto
        (normalAnchor): reversed one test (but shouldn't it really be >= ?)
 
-2001-07-16 André Pönitz  <poenitz@htwm.de>
+2001-07-16 André Pönitz  <poenitz@gmx.net>
 
        * math_cursor.[hC]: multicell selection (multicell pasete still defunct)
 
 
        * math_decorationinset.h: add std:: qualifier
 
-2001-07-12 André Pönitz  <poenitz@htwm.de>
+2001-07-12 André Pönitz  <poenitz@gmx.net>
 
        * math_updowninset.[hC]: new base class for script and bigop insets
                *.[hC]: subsequent changes to all Metric() functions
        
        * math_parser.C: small changes (\sqrt0 is read properly now)
        
-2001-07-10 André Pönitz  <poenitz@htwm.de>
+2001-07-10 André Pönitz  <poenitz@gmx.net>
        
        * math_accentinset.[hC]: rewrite
 
        * math_parser.C:
                math_cursor.C: subsequent changes
 
-2001-07-10 André Pönitz  <poenitz@htwm.de>
-
        * math_grid.C: <Delete> in the first cell of a completely empty row
          deletes that row, <C-Return> places the cursor in the first of the
          new empty cells.
@@ -75,7 +77,7 @@
        * formulabase.C (mathDispatchInsertMath): remove bogus return
        statement. 
 
-2001-07-09 André Pönitz  <poenitz@htwm.de>
+2001-07-09 André Pönitz  <poenitz@gmx.net>
 
        * math_*inset.C: Change order of arguments in MathInset constructor 
 
 
        * formulabase.C (mathDispatchInsertMath): Create an inline formula.
 
-2001-07-04 André Pönitz  <poenitz@htwm.de>
+2001-07-04 André Pönitz  <poenitz@gmx.net>
 
        * math_parser.C: fix reading of "unusual" alpha chars
 
        * xarray.[hC]: fix debug output of xarray
 
-2001-07-03 André Pönitz  <poenitz@htwm.de>
+2001-07-03 André Pönitz  <poenitz@gmx.net>
 
        * math_parser.C: fix bug where equations did not get their labels
 
        * formula.C (HandleExtern): add .c_str() to .str() (useful when
        using lyxtring)
 
-2001-04-27 André Pönitz  <poenitz@htwm.de>
+2001-04-27 André Pönitz  <poenitz@gmx.net>
 
        * math_parser.C: fix \frac handling bug introduced on 04-24
        * math_xiter.C: hotfix for merging "shared" insets
        * formula.C: fixing display after using math-insert
 
-2001-04-25 André Pönitz  <poenitz@htwm.de>
+2001-04-25 André Pönitz  <poenitz@gmx.net>
 
        * math_*.[Ch]: WriteNormal
        * formula.C: Support for new "math extern" command
 
        * math_macrotable.C: include <iostream>
 
-2001-04-24 André Pönitz  <poenitz@htwm.de>
+2001-04-24 André Pönitz  <poenitz@gmx.net>
 
        * math_macro.[Ch]:
        * math_macrotable.[Ch]:
 
        * math_rowst.C: add missing #include <config.h>.
 
-2001-03-16  André Pönitz  <poenitz@htwm.de>
+2001-03-16  André Pönitz  <poenitz@gmx.net>
 
        * math_matrixinset.h:
        * math_parinset.[Ch]:
 
        * math_cursor.C: use lyxerr instead of cerr.
 
-2001-03-15  André Pönitz  <poenitz@htwm.de>
+2001-03-15  André Pönitz  <poenitz@gmx.net>
 
        * math_cursor.C: fix bug (cursor was leaving two insets at a time
           instead of one)
 
        * math_rowst.h: make MathedRowContainer::iterator public.
 
-2001-03-15  André Pönitz  <poenitz@htwm.de>
+2001-03-15  André Pönitz  <poenitz@gmx.net>
 
        * math_parser.C: read '\nonumber' again (was broken)
 
 
        * math_cursor.C: added using directive.
 
-2001-03-15  André Pönitz  <poenitz@htwm.de>
+2001-03-15  André Pönitz  <poenitz@gmx.net>
 
        * math_rowst.h: Finally remove MathedRowSt
 
        * math_parser.C:
          math_xiter.C: changed accordingly
 
-2001-03-12  André Pönitz  <poenitz@htwm.de>
+2001-03-12  André Pönitz  <poenitz@gmx.net>
 
        *       math_rowst.h: replace MathedRowSt with MathedRowStruct,
            more robust MathedRowSt::[gs]etTab (to get rid of the constructor arg)
 
-2001-03-10  André Pönitz  <poenitz@htwm.de>
+2001-03-10  André Pönitz  <poenitz@gmx.net>
 
        * math_xiter.[Ch]:
          math_matrixinset.C: move adjustVerticalSt to the only place where
       it is used. Fix a small bug where the cached row structure and the
            actual data get out of sync after the deletion of whole rows
 
-2001-03-09  André Pönitz  <poenitz@htwm.de>
+2001-03-09  André Pönitz  <poenitz@gmx.net>
 
        * math_cursor.C: use std::vector<> in MathStackXIter
                change selstk from a pointer to the "real thing"
 
        * math_parser.C: use MathedRowContainer::insert_after
 
-2001-03-08  André Pönitz  <poenitz@htwm.de>
+2001-03-08  André Pönitz  <poenitz@gmx.net>
 
        * math_rowst.h: give MathedRowContainer an 'insert' method. 
 
        * math_matrixinset.[hC]: remove copy constructr and destructor. Those
          automatically created by the compiler are ok now.
        
-2001-03-06  André Pönitz  <poenitz@htwm.de>
+2001-03-06  André Pönitz  <poenitz@gmx.net>
 
        * array.[Ch]: factor out deep_copy,
          remove third argument from raw_pointer_insert 
        * math_rowst.h: introduction of MathRowContainer
          several files: corresponding changes
 
-2001-03-04  André Pönitz  <poenitz@htwm.de>
+2001-03-04  André Pönitz  <poenitz@gmx.net>
 
   * math_macrotemplate.[Ch]:
     math_macro.C: move update() functionality to the macro
 
        * formulamacro.C (LocalDispatch): ditto.
 
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
 
        * math_parinset.[Ch]: make array a real MathArray, not just a
          pointer to one.
 
        * array.C (MathedArray): Fix compilation problem.
 
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
 
        * array.[Ch]: "deep" copy constructor and assignment operator for
        MathArray 
        * math_iter.[Ch]: remove SetData
          several files: subsequent changes
 
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
 
        * array.[Ch]: remove constructor and  enums ARRAY_MIN_SIZE and
        ARRAY_STEP 
 
        * changes to several files because of the above.
        
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
 
        * math_iter.[Ch]: hide fcode_
        * math_xiter.C:
 
        * several files: changes so that several friends can be removed
 
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
 
        * formula.C: reformatting 
 
        * array.C (begin): new method
        (end): ditto
 
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
        
        * math_iter.[Ch]: remove 'insert', 'maxsize' and 'ARRAY_SIZE'
 
        * math_accentinset.C: 
        * math_sqrtinset.C: include LOstream.h and add using directive.
 
-2001-02-14  André Pönitz  <poenitz@htwm.de>
+2001-02-14  André Pönitz  <poenitz@gmx.net>
 
        * math_iter.C: reformatting 
 
        files they belong to. Only first attempt at cleanup more will
        follow.
        
-2001-02-12  André Pönitz  <poenitz@htwm.de>
+2001-02-12  André Pönitz  <poenitz@gmx.net>
        
        * math_macro.[hC]: replace MathMacroArgument[] with
          std::vector<MathMacroArgument>
        * math_inset.C (Metrics): Correct drawing of the multline
        environment.
 
-2001-02-12  André Pönitz  <poenitz@htwm.de>
+2001-02-12  André Pönitz  <poenitz@gmx.net>
        
        * array.[hC]: replace private variable maxsize_ with call to
        bf_.size()
 
        * Many files: add support for the align environment from amsmath.
 
-2001-02-09  André Pönitz  <poenitz@htwm.de>
+2001-02-09  André Pönitz  <poenitz@gmx.net>
 
        * array.h: replace array buffer  'byte bf[]'  by 'std::vector<byte> bf'
        * several files: subsequent changes         
        compiling with lyxstring, but STL sstream).
        (Metrics): ditto.
 
-2001-02-08  André Pönitz  <poenitz@htwm.de>
+2001-02-08  André Pönitz  <poenitz@gmx.net>
 
        * several files: get rid of reinterpret_cast.
 
index f89d4c85b66736236487e218f28aa47843f19796..11a8cb3461609884e8acfdc0706be7c74b21ebc6 100644 (file)
@@ -472,7 +472,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                // if (!mathcursor->InMacroMode() && mathcursor->pos() == 0)
                if (mathcursor->pos() == 0) {
                        bv->lockedInsetStoreUndo(Undo::DELETE);
-                       mathcursor->pullArg();
+                       mathcursor->pullArg(false);
                        bv->updateInset(this, true);
                        break;
                }
@@ -484,7 +484,10 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
 
        case LFUN_DELETE:
                bv->lockedInsetStoreUndo(Undo::DELETE);
-               mathcursor->Delete();
+               if (mathcursor->pos() == mathcursor->array().size()) 
+                       mathcursor->pullArg(true);
+               else
+                       mathcursor->Delete();
                bv->updateInset(this, true);
                break;
 
index c12b10223e2f66daf339418349505741d50efce9..e3122101f4e8d056b954a44bfb1d2bf3f61684ee 100644 (file)
@@ -1062,7 +1062,7 @@ MathInset * MathCursor::enclosing(MathInsetTypes t, int & idx) const
 }
 
 
-void MathCursor::pullArg()
+void MathCursor::pullArg(bool goright)
 {
        // pullArg
        dump("pullarg");
@@ -1070,6 +1070,8 @@ void MathCursor::pullArg()
        if (pop()) {
                array().erase(cursor().pos_);
                array().insert(cursor().pos_, a);
+               if (goright) 
+                       cursor().pos_ += a.size();
        }
 }
 
index c46852cf3e681aad45b560a243abdc4927e75b9d..d0a71e46fc8338ce2f09c99f040b8e01744de14a 100644 (file)
@@ -167,7 +167,7 @@ public:
        ///
        void idxPrev();
        ///
-       void pullArg();
+       void pullArg(bool goright);
        ///
        bool isInside(MathInset *) const;
        ///