]> git.lyx.org Git - lyx.git/commitdiff
A patch from Dekel (macros in RTL mode)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 2 Nov 2000 16:31:05 +0000 (16:31 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 2 Nov 2000 16:31:05 +0000 (16:31 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1186 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/insets/lyxinset.h
src/mathed/formulamacro.h
src/mathed/math_symbols.C
src/text.C

index 3408fd271d10e4cbeff0d4c0ea245c93b046b85d..718edd956caca946d6462475d11f2b531b702091 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-10-27   Dekel Tsur  <dekelts@tau.ac.il>
+
+       * src/mathed/formulamacro.h (LyxCode) Return MATHMACRO_CODE instead
+       of MATH_CODE. This fixes a bug with math-macros in RTL text.
+
+       * src/text.C (PrepareToPrint): Show math-macros block aligned.
+
 2000-11-02  Juergen Vigna  <jug@sad.it>
 
        * src/insets/insettext.C (LocalDispatch): return a DISPATCHED_NOUPDATE
index ac3b65768112d23d0d4b4cb7369f5425b7af5f8b..da544af9be8ef8a69550b5836c5b1829ccce3b2c 100644 (file)
@@ -103,7 +103,9 @@ public:
                ///
                THEOREM_CODE, // 30
                ///
-               CAPTION_CODE
+               CAPTION_CODE,
+               ///
+               MATHMACRO_CODE
        };
 
        ///
index 1e75f11717340e858bd10995365890b40861b5de..5eb113fb7215f0505e83101d582e17e00ed53657 100644 (file)
@@ -57,7 +57,8 @@ public:
        int DocBook(Buffer const *, std::ostream &) const;
        ///
        Inset * Clone(Buffer const &) const;
-
+       ///
+       Inset::Code LyxCode() const { return Inset::MATHMACRO_CODE; }
        /// what appears in the minibuffer when opening
        string const EditMessage() const;
        ///
index 62ad6d3d67a6e489b837c6a85cbd1c4b5b57f8b3..f36000774d83b54a57dc58928bd7431f4412cd68 100644 (file)
@@ -349,7 +349,8 @@ bool math_insert_greek(char c)
         if (greek_kb_flag_save < 2)
                 current_view->unlockInset(current_view->theLockingInset());
       } else
-        if (current_view->theLockingInset()->LyxCode() == Inset::MATH_CODE)
+        if (current_view->theLockingInset()->LyxCode() == Inset::MATH_CODE ||
+            current_view->theLockingInset()->LyxCode() == Inset::MATHMACRO_CODE)
                static_cast<InsetFormula*>(current_view->theLockingInset())->LocalDispatch(current_view, LFUN_SELFINSERT, tmp);
         else
                lyxerr << "Math error: attempt to write on a wrong "
@@ -371,7 +372,8 @@ void math_insert_symbol(string const & s)
         new_inset->Edit(current_view, 0, 0, 0);
         new_inset->InsertSymbol(current_view, s);
       } else
-       if (current_view->theLockingInset()->LyxCode() == Inset::MATH_CODE)
+       if (current_view->theLockingInset()->LyxCode() == Inset::MATH_CODE ||
+           current_view->theLockingInset()->LyxCode() == Inset::MATHMACRO_CODE)
                static_cast<InsetFormula*>(current_view->theLockingInset())->InsertSymbol(current_view, s);
         else 
                lyxerr << "Math error: attempt to write on a wrong "
index 0e50ffcf8c398d9682c5efc8793206833722de8a..e7383aa369963f48c1ab8c853127b1fb297e0760 100644 (file)
@@ -2227,7 +2227,8 @@ void LyXText::PrepareToPrint(BufferView * bview,
           if (row->par()->GetChar(row->pos()) == LyXParagraph::META_INSET
               && (inset=row->par()->GetInset(row->pos()))
               && (inset->display())) // || (inset->scroll() < 0)))
-            align = LYX_ALIGN_CENTER;
+            align = (inset->LyxCode() == Inset::MATHMACRO_CODE)
+                    ? LYX_ALIGN_BLOCK : LYX_ALIGN_CENTER;
 
           switch (align) {
            case LYX_ALIGN_BLOCK: