Fix for math macros in an RTL paragraph.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/lyx-1_1_5@1192 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-11-03 14:35:03 +00:00
parent 99b05c2c7c
commit de977bea61
5 changed files with 17 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 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> 2000-11-02 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lib/reLyX/MakePreamble.pm (translate_preamble): fix reading of * lib/reLyX/MakePreamble.pm (translate_preamble): fix reading of

View File

@ -92,7 +92,9 @@ public:
/// ///
SPECIALCHAR_CODE, SPECIALCHAR_CODE,
/// ///
TABULAR_CODE TABULAR_CODE,
///
MATHMACRO_CODE
}; };
enum EDITABLE { enum EDITABLE {

View File

@ -56,7 +56,8 @@ public:
int DocBook(std::ostream &) const; int DocBook(std::ostream &) const;
/// ///
Inset * Clone() const; Inset * Clone() const;
///
Inset::Code LyxCode() const { return Inset::MATHMACRO_CODE; }
/// what appears in the minibuffer when opening /// what appears in the minibuffer when opening
char const * EditMessage() const; char const * EditMessage() const;
/// ///

View File

@ -376,7 +376,8 @@ void math_insert_symbol(char const * s)
new_inset->Edit(current_view, 0, 0, 0); new_inset->Edit(current_view, 0, 0, 0);
new_inset->InsertSymbol(current_view, s); new_inset->InsertSymbol(current_view, s);
} else } else
if (current_view->the_locking_inset->LyxCode() == Inset::MATH_CODE) if (current_view->the_locking_inset->LyxCode() == Inset::MATH_CODE ||
current_view->the_locking_inset->LyxCode() == Inset::MATHMACRO_CODE)
static_cast<InsetFormula*>(current_view->the_locking_inset)->InsertSymbol(current_view, s); static_cast<InsetFormula*>(current_view->the_locking_inset)->InsertSymbol(current_view, s);
else else
lyxerr << "Math error: attempt to write on a wrong " lyxerr << "Math error: attempt to write on a wrong "

View File

@ -2964,8 +2964,9 @@ void LyXText::PrepareToPrint(Row * row, float & x,
if (row->par->GetChar(row->pos) == LyXParagraph::META_INSET if (row->par->GetChar(row->pos) == LyXParagraph::META_INSET
&& row->par->GetInset(row->pos) && row->par->GetInset(row->pos)
&& row->par->GetInset(row->pos)->display()) && row->par->GetInset(row->pos)->display())
align = LYX_ALIGN_CENTER; align = (row->par->GetInset(row->pos)->LyxCode()
== Inset::MATHMACRO_CODE)
? LYX_ALIGN_BLOCK : LYX_ALIGN_CENTER;
switch (align) { switch (align) {
case LYX_ALIGN_BLOCK: case LYX_ALIGN_BLOCK:
ns = NumberOfSeparators(row); ns = NumberOfSeparators(row);