]> git.lyx.org Git - features.git/commitdiff
mathed42.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 6 Mar 2001 11:13:14 +0000 (11:13 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 6 Mar 2001 11:13:14 +0000 (11:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1685 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_cursor.C

index 6be2e3dfde315a3603a49ddb2653a38f97f50faa..7d87037d9ecb5c7312351009bfd1ef5aaca4149f 100644 (file)
@@ -1,10 +1,12 @@
-
 2001-03-06  André Pönitz  <poenitz@htwm.de>
        * array.[Ch]: factor out deep_copy,
          remove third argument from raw_pointer_insert 
 
        * mathiter.[Ch]: remove unused function Clear() 
 
+       * mathcursor.C: change signature of MathStackXIter:push()
+         whitespace changes
+
 2001-03-04  André Pönitz  <poenitz@htwm.de>
   * math_macrotemplate.[Ch]:
     math_macro.C: move update() functionality to the macro
index 76769f4f46f66453b6f4d9897849c331fc557517..5013fe0de77ff30aa91b95d02c06bed62157e7f6 100644 (file)
@@ -80,8 +80,8 @@ struct MathStackXIter {
                delete[] item;
        }
 
-       void push(MathedXIter ** a) {
-               *a = &item[i++];
+       MathedXIter * push() {
+               return &item[i++];
        }
 
        MathedXIter * pop() {
@@ -141,7 +141,7 @@ void MathedCursor::SetPar(MathParInset * p)
        macro_mode = false;
        selection  = false; // not SelClear() ?
        mathstk.Reset();
-       mathstk.push(&cursor);
+       cursor = mathstk.push();
        par = p;
        cursor->SetData(par);
 }
@@ -231,7 +231,7 @@ bool MathedCursor::Left(bool sel)
                                return result;
 
                        p->setArgumentIdx(p->getMaxArgumentIdx());
-                       mathstk.push(&cursor);
+                       cursor = mathstk.push();
                        cursor->SetData(p);
                        cursor->GoLast();
                }
@@ -259,7 +259,7 @@ bool MathedCursor::Push()
                MathParInset * p = cursor->GetActiveInset();
                if (!p)
                        return false;
-               mathstk.push(&cursor);
+               cursor = mathstk.push();
                cursor->SetData(p);
                return true;
        }
@@ -300,7 +300,7 @@ bool MathedCursor::Right(bool sel)
                        return cursor->Next();
                        }
                        p->setArgumentIdx(0);
-                       mathstk.push(&cursor);
+                       cursor = mathstk.push();
                        cursor->SetData(p);
                        result = true;
                } else
@@ -331,7 +331,7 @@ void MathedCursor::SetPos(int x, int y)
 
        lastcode = LM_TC_MIN;
        mathstk.Reset();
-       mathstk.push(&cursor);
+       cursor = mathstk.push();
        cursor->SetData(par);
        cursor->fitCoord(x, y);
 
@@ -340,7 +340,7 @@ void MathedCursor::SetPos(int x, int y)
                        MathParInset * p = cursor->GetActiveInset();
                        if (p->Inside(x, y)) {
                                p->SetFocus(x, y);
-                               mathstk.push(&cursor);
+                               cursor = mathstk.push();
                                cursor->SetData(p);
                                cursor->fitCoord(x, y);
                                continue;
@@ -362,7 +362,7 @@ void MathedCursor::Home()
                MacroModeClose();
        clearLastCode();
        mathstk.Reset();
-       mathstk.push(&cursor);
+       cursor = mathstk.push();
        cursor->GoBegin();
 }
 
@@ -373,7 +373,7 @@ void MathedCursor::End()
                MacroModeClose();
        clearLastCode();
        mathstk.Reset();
-       mathstk.push(&cursor);
+       cursor = mathstk.push();
        cursor->GoLast();
 }
 
@@ -655,24 +655,24 @@ bool MathedCursor::Down(bool sel)
 
        result = cursor->Down();
        if (!result && cursor->getPar()) {
-       MathParInset * p= cursor->getPar();
-       if (p->GetType() == LM_OT_SCRIPT) {
-       MathedXIter * cx = mathstk.Item(1);
-       bool is_up = (cx->GetChar() == LM_TC_UP);
-       cursor = mathstk.pop();
-       cursor->Next();
-       result = (is_up) ? true: Down();
-       } else {
-       result = (p->getArgumentIdx() < p->getMaxArgumentIdx());
-       if (result) {
-       p->setArgumentIdx(p->getArgumentIdx() + 1);
-       cursor->SetData(p);
-       }
-       }
-       if (!result && !mathstk.Empty()) {
-       cursor = mathstk.pop();
-       return Down(sel);
-       }
+               MathParInset * p= cursor->getPar();
+               if (p->GetType() == LM_OT_SCRIPT) {
+                       MathedXIter * cx = mathstk.Item(1);
+                       bool is_up = (cx->GetChar() == LM_TC_UP);
+                       cursor = mathstk.pop();
+                       cursor->Next();
+                       result = (is_up) ? true : Down();
+               } else {
+                       result = (p->getArgumentIdx() < p->getMaxArgumentIdx());
+                       if (result) {
+                               p->setArgumentIdx(p->getArgumentIdx() + 1);
+                               cursor->SetData(p);
+                       }
+               }
+               if (!result && !mathstk.Empty()) {
+                       cursor = mathstk.pop();
+                       return Down(sel);
+               }
        }
        return result;
 }