+2002-07-13 Dekel Tsur <dekelts@tau.ac.il>
+
+ * lyxfunc.C (dispatch): Correct cursor behaviour when exiting
+ an inset in a RTL paragraph.
+
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: repaint after a font size update
+2002-07-13 Dekel Tsur <dekelts@tau.ac.il>
+
+ * insettext.C (unlockInsetInInset): Correct cursor behaviour for
+ RTL paragraphs.
+
2002-07-05 Angus Leeming <leeming@lyx.org>
* inset.h (generatePreview): new virtual method.
the_locking_inset = 0;
inset_x = 0;
inset_y = 0;
- if (front)
- actcell = 0;
- else
- actcell = tabular->GetNumberOfCells() - 1;
+ if (front) {
+ if (isRightToLeft(bv))
+ actcell = tabular->GetLastCellInRow(0);
+ else
+ actcell = 0;
+ } else {
+ if (isRightToLeft(bv))
+ actcell = tabular->GetFirstCellInRow(tabular->rows()-1);
+ else
+ actcell = tabular->GetNumberOfCells() - 1;
+ }
clearSelection();
resetPos(bv);
bv->fitCursor();
getLyXText(bv)->updateInset(bv, inset);
the_locking_inset = 0;
if (lr)
- moveRight(bv, false);
+ moveRightIntern(bv, true, false);
old_par = 0; // force layout setting
if (scroll())
scroll(bv, 0.0F);
InsetText::moveRight(BufferView * bv, bool activate_inset, bool selecting)
{
if (getLyXText(bv)->cursor.par()->isRightToLeftPar(bv->buffer()->params))
- return moveLeftIntern(bv, true, activate_inset, selecting);
+ return moveLeftIntern(bv, false, activate_inset, selecting);
else
return moveRightIntern(bv, true, activate_inset, selecting);
}
InsetText::moveLeft(BufferView * bv, bool activate_inset, bool selecting)
{
if (getLyXText(bv)->cursor.par()->isRightToLeftPar(bv->buffer()->params))
- return moveRightIntern(bv, false, activate_inset, selecting);
+ return moveRightIntern(bv, true, activate_inset, selecting);
else
return moveLeftIntern(bv, false, activate_inset, selecting);
}
goto exit_with_message;
// If UNDISPATCHED, just soldier on
else if (result == UpdatableInset::FINISHED) {
- if (TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
- TEXT()->cursorRight(owner->view());
- moveCursorUpdate(true, false);
- owner->showState();
- }
- goto exit_with_message;
+ goto exit_with_message;
+ // We do not need special RTL handling here:
+ // FINISHED means that the cursor should be
+ // one position after the inset.
} else if (result == UpdatableInset::FINISHED_RIGHT) {
- if (!TEXT()->cursor.par()->isRightToLeftPar(owner->buffer()->params)) {
- TEXT()->cursorRight(owner->view());
- moveCursorUpdate(true, false);
- owner->showState();
- }
+ TEXT()->cursorRight(owner->view());
+ moveCursorUpdate(true, false);
+ owner->showState();
goto exit_with_message;
} else if (result == UpdatableInset::FINISHED_UP) {
if (TEXT()->cursor.irow()->previous()) {