]> git.lyx.org Git - features.git/commitdiff
RTL fixes
authorDekel Tsur <dekelts@tau.ac.il>
Sat, 13 Jul 2002 14:56:42 +0000 (14:56 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Sat, 13 Jul 2002 14:56:42 +0000 (14:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4630 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/insets/ChangeLog
src/insets/insettabular.C
src/insets/insettext.C
src/lyxfunc.C

index 21cd8f7092b7bc8bfaf866ec3a3269ca8f4c0490..baab579b368267103d963c2d57228dcec3229d70 100644 (file)
@@ -1,3 +1,8 @@
+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
index d0d9a64b0da91c3d1ec885590d8140b34bb1d2c2..ac92d8bca4c2638f0dc40c3954ce14d4a98e5d9d 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 39138732feb10d92303748b8b8d9a322f7596993..d205b6455d0ab74696dde6eec7446b72d0fcc1d9 100644 (file)
@@ -585,10 +585,17 @@ void InsetTabular::edit(BufferView * bv, bool front)
        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();
index c172d3ec13e7c9606fdf5b4d6ac813e8476eed90..21d24736d625f2674d326cf8cf62a0232bb6a985 100644 (file)
@@ -932,7 +932,7 @@ bool InsetText::unlockInsetInInset(BufferView * bv, UpdatableInset * inset,
                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);
@@ -1842,7 +1842,7 @@ UpdatableInset::RESULT
 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);
 }
@@ -1852,7 +1852,7 @@ UpdatableInset::RESULT
 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);
 }
index 8e20115b173f973dc1845cda78840e3dae7240a3..e1d32d92f5e780753b27b09bd894c9f7ddff877f 100644 (file)
@@ -878,18 +878,14 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                                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()) {