]> git.lyx.org Git - lyx.git/commitdiff
remove unneeded member
authorAndré Pönitz <poenitz@gmx.net>
Thu, 11 Jul 2002 10:20:31 +0000 (10:20 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 11 Jul 2002 10:20:31 +0000 (10:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4600 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_boxinset.C
src/mathed/math_boxinset.h
src/mathed/math_nestinset.C
src/mathed/math_nestinset.h
src/mathed/math_parser.C

index 3c675a60285105e689c0c22e86dbfa0aa06269f2..817f2022f85056e514fd33cf76f2348f06419925 100644 (file)
@@ -12,7 +12,7 @@
 
 
 MathBoxInset::MathBoxInset(string const & name)
-       : MathGridInset(1, 1), name_(name)
+       : MathNestInset(1), name_(name)
 {}
 
 
@@ -45,15 +45,18 @@ void MathBoxInset::rebreak()
 void MathBoxInset::metrics(MathMetricsInfo & mi) const
 {
        MathFontSetChanger dummy(mi.base, "textnormal");
-       MathGridInset::metrics(mi);
+       xcell(0).metrics(mi);
+       ascent_  = xcell(0).ascent()  + 1;
+       descent_ = xcell(0).descent() + 1;
+       width_   = xcell(0).width()   + 2;
 }
 
 
 void MathBoxInset::draw(MathPainterInfo & pi, int x, int y) const
 {
        MathFontSetChanger dummy(pi.base, "textnormal");
-       MathGridInset::draw(pi, x, y);
-       mathed_draw_framebox(pi, x, y, this);
+       xcell(0).draw(pi, x, y);
+       drawMarkers2(pi, x + 1, y);
 }
 
 
index 07f3440d96349a48861c0e45891e3d664468d4b5..dca47ceb0646e2c0ee4f47bec60cdd342220ea3c 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef MATH_BOXINSET_H
 #define MATH_BOXINSET_H
 
-#include "math_gridinset.h"
+#include "math_nestinset.h"
 #include "LString.h"
 
 #ifdef __GNUG__
@@ -13,7 +13,7 @@ class LyXFont;
 
 /// Support for \\mbox
 
-class MathBoxInset : public MathGridInset {
+class MathBoxInset : public MathNestInset {
 public:
        ///
        explicit MathBoxInset(string const & name);
@@ -37,8 +37,6 @@ public:
        void infoize(std::ostream & os) const;
 
 private:
-       ///
-       mutable MathMetricsInfo mi_;
        ///
        string name_;
 };
index 91f11b36c9995f7725870a25fdc1e1266575177f..a4e822ab3020063f58052deca9ce8596ea5225c2 100644 (file)
@@ -63,6 +63,21 @@ void MathNestInset::metrics(MathMetricsInfo const & mi) const
 }
 
 
+void MathNestInset::metricsMarkers() const
+{
+       descent_ += 1;
+       width_   += 2;
+}
+
+
+void MathNestInset::metricsMarkers2() const
+{
+       ascent_  += 1;
+       descent_ += 1;
+       width_   += 2;
+}
+
+
 bool MathNestInset::idxNext(idx_type & idx, pos_type & pos) const
 {
        if (idx + 1 >= nargs())
index e9b578f0b3182956bb8d692ba4a978829aec0ed6..dfe7c3f0e37d2ed002067002e97dca94ea9b88e5 100644 (file)
@@ -22,6 +22,10 @@ public:
 
        /// the size is usuall some sort of convex hull of the cells
        void metrics(MathMetricsInfo const & mi) const;
+       /// add space for markers
+       void metricsMarkers() const;
+       /// add space for markers
+       void metricsMarkers2() const;
        /// draw background if locked
        void draw(MathPainterInfo & pi, int x, int y) const;
        /// draw two angular markers
index e4cf20698eb95ac83f7c6516a658cbc176b03440..538e5c0d81a48d5a436370076da3af3ed6c0fae4 100644 (file)
@@ -1062,12 +1062,6 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags,
                                        return;
                                }
 
-                               else if (l->inset == "mbox") {
-                                       // switch to text mode
-                                       cell->push_back(createMathInset(t.cs()));
-                                       parse_into(cell->back()->cell(0), FLAG_ITEM, mathmode);
-                               }
-
                                else if (l->inset == "style") {
                                        cell->push_back(createMathInset(t.cs()));
                                        parse_into(cell->back()->cell(0), flags, mathmode);
@@ -1088,7 +1082,7 @@ void Parser::parse_into1(MathGridInset & grid, unsigned flags,
                                else {
                                        MathAtom p = createMathInset(t.cs());
                                        for (MathInset::idx_type i = 0; i < p->nargs(); ++i)
-                                               parse_into(p->cell(i), FLAG_ITEM, l->extra == "mathmode");
+                                               parse_into(p->cell(i), FLAG_ITEM, l->extra != "forcetext");
                                        cell->push_back(p);
                                }
                        }