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
This commit is contained in:
Jean-Marc Lasgouttes 2000-11-02 16:31:05 +00:00
parent cf6dacdb0a
commit 916c6bf9d8
5 changed files with 18 additions and 5 deletions

View File

@ -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

View File

@ -103,7 +103,9 @@ public:
///
THEOREM_CODE, // 30
///
CAPTION_CODE
CAPTION_CODE,
///
MATHMACRO_CODE
};
///

View 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;
///

View 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 "

View 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: