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
This commit is contained in:
Dov Feldstern 2007-11-05 19:44:03 +00:00
parent ddd82f7aa4
commit cd95a4bae8
9 changed files with 34 additions and 34 deletions

View File

@ -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

View File

@ -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)) {

View File

@ -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;
///

View File

@ -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();

View File

@ -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;
///

View File

@ -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 {

View File

@ -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

View File

@ -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;
}

View File

@ -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