From cd95a4bae8cc2a134597369a3cf8b6ea4ddf74e4 Mon Sep 17 00:00:00 2001 From: Dov Feldstern Date: Mon, 5 Nov 2007 19:44:03 +0000 Subject: [PATCH] Getting rid of LTR bias --- part 4/4 This is the final patch (at least for now). This one deals with the idxFoo methods in the math insets. The previous patches in the series are r21128, r21244 and r21448. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21449 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/Inset.h | 12 ++++++------ src/mathed/InsetMathFrac.cpp | 4 ++-- src/mathed/InsetMathFrac.h | 8 ++++---- src/mathed/InsetMathGrid.cpp | 8 ++++---- src/mathed/InsetMathGrid.h | 4 ++-- src/mathed/InsetMathNest.cpp | 8 ++++---- src/mathed/InsetMathNest.h | 12 ++++++------ src/mathed/InsetMathScript.cpp | 4 ++-- src/mathed/InsetMathScript.h | 8 ++++---- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/insets/Inset.h b/src/insets/Inset.h index e432a6406b..c0dfb170c5 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -170,14 +170,14 @@ public: virtual bool isActive() const { return nargs() > 0; } /// Where should we go when we press the up or down cursor key? virtual bool idxUpDown(Cursor & cur, bool up) const; - /// Move one cell to the left - virtual bool idxLeft(Cursor &) const { return false; } - /// Move one cell to the right - virtual bool idxRight(Cursor &) const { return false; } + /// Move one cell backwards + virtual bool idxBackward(Cursor &) const { return false; } + /// Move one cell forward + virtual bool idxForward(Cursor &) const { return false; } - /// Move one physical cell up + /// Move to the next cell virtual bool idxNext(Cursor &) const { return false; } - /// Move one physical cell down + /// Move to the previous cell virtual bool idxPrev(Cursor &) const { return false; } /// Target pos when we enter the inset while moving forward diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 50bfbb4ade..aef7818e5d 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -79,7 +79,7 @@ InsetMathFrac const * InsetMathFrac::asFracInset() const } -bool InsetMathFrac::idxRight(Cursor & cur) const +bool InsetMathFrac::idxForward(Cursor & cur) const { InsetMath::idx_type target = 0; if (kind_ == UNIT || (kind_ == UNITFRAC && nargs() == 3)) { @@ -97,7 +97,7 @@ bool InsetMathFrac::idxRight(Cursor & cur) const } -bool InsetMathFrac::idxLeft(Cursor & cur) const +bool InsetMathFrac::idxBackward(Cursor & cur) const { InsetMath::idx_type target = 0; if (kind_ == UNIT || (kind_ == UNITFRAC && nargs() == 3)) { diff --git a/src/mathed/InsetMathFrac.h b/src/mathed/InsetMathFrac.h index 0788747d39..ffcab06353 100644 --- a/src/mathed/InsetMathFrac.h +++ b/src/mathed/InsetMathFrac.h @@ -26,9 +26,9 @@ public: /// bool idxUpDown(Cursor &, bool up) const; /// - bool idxLeft(Cursor &) const { return false; } + bool idxBackward(Cursor &) const { return false; } /// - bool idxRight(Cursor &) const { return false; } + bool idxForward(Cursor &) const { return false; } }; @@ -49,9 +49,9 @@ public: /// explicit InsetMathFrac(Kind kind = FRAC, idx_type ncells = 2); /// - bool idxRight(Cursor &) const; + bool idxForward(Cursor &) const; /// - bool idxLeft(Cursor &) const; + bool idxBackward(Cursor &) const; /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index da27366a7c..dbc79f5902 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -830,9 +830,9 @@ bool InsetMathGrid::idxUpDown(Cursor & cur, bool up) const } -bool InsetMathGrid::idxLeft(Cursor & cur) const +bool InsetMathGrid::idxBackward(Cursor & cur) const { - // leave matrix if on the left hand edge + // leave matrix if at the front edge if (cur.col() == 0) return false; --cur.idx(); @@ -841,9 +841,9 @@ bool InsetMathGrid::idxLeft(Cursor & cur) const } -bool InsetMathGrid::idxRight(Cursor & cur) const +bool InsetMathGrid::idxForward(Cursor & cur) const { - // leave matrix if on the right hand edge + // leave matrix if at the back edge if (cur.col() + 1 == ncols()) return false; ++cur.idx(); diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index d010850894..e49aa500fe 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -155,9 +155,9 @@ public: /// bool idxUpDown(Cursor &, bool up) const; /// - bool idxLeft(Cursor &) const; + bool idxBackward(Cursor &) const; /// - bool idxRight(Cursor &) const; + bool idxForward(Cursor &) const; /// bool idxFirst(Cursor &) const; /// diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 810dfaa275..f2f55151dd 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -164,7 +164,7 @@ bool InsetMathNest::idxNext(Cursor & cur) const } -bool InsetMathNest::idxRight(Cursor & cur) const +bool InsetMathNest::idxForward(Cursor & cur) const { return idxNext(cur); } @@ -181,7 +181,7 @@ bool InsetMathNest::idxPrev(Cursor & cur) const } -bool InsetMathNest::idxLeft(Cursor & cur) const +bool InsetMathNest::idxBackward(Cursor & cur) const { return idxPrev(cur); } @@ -509,7 +509,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) if (cur.pos() != cur.lastpos() && cur.openable(cur.nextAtom())) { cur.pushBackward(*cur.nextAtom().nucleus()); cur.inset().idxFirst(cur); - } else if (cur.posForward() || idxRight(cur) + } else if (cur.posForward() || idxForward(cur) || cur.popForward() || cur.selection()) ; else { @@ -529,7 +529,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) cur.posBackward(); cur.push(*cur.nextAtom().nucleus()); cur.inset().idxLast(cur); - } else if (cur.posBackward() || idxLeft(cur) + } else if (cur.posBackward() || idxBackward(cur) || cur.popBackward() || cur.selection()) ; else { diff --git a/src/mathed/InsetMathNest.h b/src/mathed/InsetMathNest.h index 3b54b3a8af..4f12d7d7bf 100644 --- a/src/mathed/InsetMathNest.h +++ b/src/mathed/InsetMathNest.h @@ -52,14 +52,14 @@ public: /// Inset * editXY(Cursor & cur, int x, int y); - /// order of movement through the cells when pressing the left key - bool idxLeft(Cursor &) const; - /// order of movement through the cells when pressing the right key - bool idxRight(Cursor &) const; + /// order of movement through the cells when moving backwards + bool idxBackward(Cursor &) const; + /// order of movement through the cells when moving forward + bool idxForward(Cursor &) const; - /// move one physical cell up + /// move to next cell bool idxNext(Cursor &) const; - /// move one physical cell down + /// move to previous cell bool idxPrev(Cursor &) const; /// target pos when we enter the inset while moving forward diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index 71061b18b4..b91fbf6401 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -468,13 +468,13 @@ Inset::idx_type InsetMathScript::idxOfScript(bool up) const } -bool InsetMathScript::idxRight(Cursor &) const +bool InsetMathScript::idxForward(Cursor &) const { return false; } -bool InsetMathScript::idxLeft(Cursor &) const +bool InsetMathScript::idxBackward(Cursor &) const { return false; } diff --git a/src/mathed/InsetMathScript.h b/src/mathed/InsetMathScript.h index ad6b1f5c5e..e26e73824a 100644 --- a/src/mathed/InsetMathScript.h +++ b/src/mathed/InsetMathScript.h @@ -41,10 +41,10 @@ public: /// void drawT(TextPainter & pi, int x, int y) const; - /// move cursor left - bool idxLeft(Cursor & cur) const; - /// move cursor right - bool idxRight(Cursor & cur) const; + /// move cursor backwards + bool idxBackward(Cursor & cur) const; + /// move cursor forward + bool idxForward(Cursor & cur) const; /// move cursor up or down bool idxUpDown(Cursor & cur, bool up) const; /// Target pos when we enter the inset while moving forward -- 2.39.2