]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNest.cpp
remove unneeded header.
[lyx.git] / src / mathed / InsetMathNest.cpp
index 0be357045eab89e563faf52a02345a95b181256e..8c835a0f7f06d25f8754b62944888a191e0b1f12 100644 (file)
@@ -44,7 +44,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "gettext.h"
-#include "LyXText.h"
+#include "Text.h"
 #include "OutputParams.h"
 #include "Undo.h"
 
@@ -404,7 +404,7 @@ void InsetMathNest::handleFont
 void InsetMathNest::handleFont2(Cursor & cur, docstring const & arg)
 {
        recordUndo(cur, Undo::ATOMIC);
-       LyXFont font;
+       Font font;
        bool b;
        bv_funcs::string2font(to_utf8(arg), font, b);
        if (font.color() != Color::inherit) {
@@ -492,6 +492,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.autocorrect() = false;
                cur.clearTargetX();
                cur.macroModeClose();
+               if (cur.isRTL() )
+                       goto goto_char_backwards;
+
+goto_char_forwards:
                if (cur.pos() != cur.lastpos() && cur.openable(cur.nextAtom())) {
                        cur.pushLeft(*cur.nextAtom().nucleus());
                        cur.inset().idxFirst(cur);
@@ -511,6 +515,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.autocorrect() = false;
                cur.clearTargetX();
                cur.macroModeClose();
+               if (cur.isRTL())
+                       goto goto_char_forwards;
+
+goto_char_backwards:
                if (cur.pos() != 0 && cur.openable(cur.prevAtom())) {
                        cur.posLeft();
                        cur.push(*cur.nextAtom().nucleus());
@@ -915,7 +923,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                                                                rdelim)));
                }
                // Don't call cur.undispatched() if we did nothing, this would
-               // lead to infinite recursion via LyXText::dispatch().
+               // lead to infinite recursion via Text::dispatch().
                break;
        }
 
@@ -983,7 +991,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
        }
 
        default:
-               InsetMathDim::doDispatch(cur, cmd);
+               InsetMath::doDispatch(cur, cmd);
                break;
        }
 }
@@ -1144,7 +1152,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd)
        } else if (cmd.button() == mouse_button::button2) {
                MathData ar;
                if (cap::selection()) {
-                       // See comment in LyXText::dispatch why we do this
+                       // See comment in Text::dispatch why we do this
                        cap::copySelectionToStack();
                        cmd = FuncRequest(LFUN_PASTE, "0");
                        doDispatch(cur, cmd);