From: Jean-Marc Lasgouttes Date: Thu, 2 Nov 2000 16:31:05 +0000 (+0000) Subject: A patch from Dekel (macros in RTL mode) X-Git-Tag: 1.6.10~21849 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=916c6bf9d8e994290b87885b6f39c9bbe8159453;p=lyx.git A patch from Dekel (macros in RTL mode) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1186 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/ChangeLog b/ChangeLog index 3408fd271d..718edd956c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-10-27 Dekel Tsur + + * 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 * src/insets/insettext.C (LocalDispatch): return a DISPATCHED_NOUPDATE diff --git a/src/insets/lyxinset.h b/src/insets/lyxinset.h index ac3b657681..da544af9be 100644 --- a/src/insets/lyxinset.h +++ b/src/insets/lyxinset.h @@ -103,7 +103,9 @@ public: /// THEOREM_CODE, // 30 /// - CAPTION_CODE + CAPTION_CODE, + /// + MATHMACRO_CODE }; /// diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index 1e75f11717..5eb113fb72 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -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; /// diff --git a/src/mathed/math_symbols.C b/src/mathed/math_symbols.C index 62ad6d3d67..f36000774d 100644 --- a/src/mathed/math_symbols.C +++ b/src/mathed/math_symbols.C @@ -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(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(current_view->theLockingInset())->InsertSymbol(current_view, s); else lyxerr << "Math error: attempt to write on a wrong " diff --git a/src/text.C b/src/text.C index 0e50ffcf8c..e7383aa369 100644 --- a/src/text.C +++ b/src/text.C @@ -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: