Better fix for #6049 and similar cases with other math insets.

In order to fix #6047, I needed a further mode other than MATH_MODE
and TEXT_MODE. In this mode, LyX should have behaved as in TEXT_MODE
but should also have allowed math mode commands. Well, this mode was
already implemented in LyX as UNDECIDED_MODE. Currently, this mode is
used nowhere except in the strange case where a math hull is not
present. It cannot be created by any other mean than editing a .lyx
file and getting rid of the $...$ math delimiters. This kind of
file can be reloaded in LyX and you would see a strange math formula
in text mode outside of mathed. Of course, trying to latex this file
would cause errors. After this commit, this strange mode is still
possible, but now all math insets correctly declare that their mode
is math mode (instead of undecided, and unless they state otherwise)
and bugs such as #6049 are fixed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30385 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2009-07-06 00:48:07 +00:00
parent e8ecb8b483
commit 14c5adf034
2 changed files with 3 additions and 2 deletions

View File

@ -98,6 +98,9 @@ public:
/// this is overridden in math text insets (i.e. mbox)
bool inMathed() const { return true; }
/// this is overridden by specific insets
virtual mode_type currentMode() const { return MATH_MODE; }
/// the ascent of the inset above the baseline
/// compute the size of the object for text based drawing
virtual void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;

View File

@ -25,8 +25,6 @@ public:
///
explicit InsetMathFracBase(idx_type ncells = 2);
///
mode_type currentMode() const { return MATH_MODE; }
///
bool idxUpDown(Cursor &, bool up) const;
///
bool idxBackward(Cursor &) const { return false; }