]> git.lyx.org Git - lyx.git/commitdiff
Better fix for #6049 and similar cases with other math insets.
authorEnrico Forestieri <forenr@lyx.org>
Mon, 6 Jul 2009 00:48:07 +0000 (00:48 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 6 Jul 2009 00:48:07 +0000 (00:48 +0000)
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

src/mathed/InsetMath.h
src/mathed/InsetMathFrac.h

index 6b178a7a2dc3df1d470c531f2df1e33ae1d9f30c..8aef3591fa6657031a65487d500c4a0ef7893710 100644 (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;
index 7e22a24cfe5031b33b8368a1e139b212b512ecc2..b2c55666b216835edfe4a2c44f0f25debc8169ee 100644 (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; }