From: Lars Gullik Bjønnes Date: Tue, 6 Mar 2001 11:13:14 +0000 (+0000) Subject: mathed42.diff X-Git-Tag: 1.6.10~21517 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=08825145ee4507e74a70a7567cede809461f8aa3;p=features.git mathed42.diff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1685 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 6be2e3dfde..7d87037d9e 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,10 +1,12 @@ - 2001-03-06 André Pönitz * 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 * math_macrotemplate.[Ch]: math_macro.C: move update() functionality to the macro diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 76769f4f46..5013fe0de7 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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; }