On Tue, Oct 01, 2002 at 06:26:15PM +0100, Angus Leeming wrote:
> > With the tiny problem that it does not work. The Changer
> > undoes its changes when it goes out of scope.
When I think about it: Maybe you'll like the following patch more:
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
? tmp.diff
? 1.diff
? .Makefile.am.swp
? haveit
? script.diff
? all
? rmcopyright.sh
? .math_arrayinset.C.swp
? shared_ptr.diff
Index: math_arrayinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_arrayinset.C,v
retrieving revision 1.33
diff -u -p -r1.33 math_arrayinset.C
--- math_arrayinset.C 25 Sep 2002 12:49:55 -0000 1.33
+++ math_arrayinset.C 1 Oct 2002 17:35:44 -0000
@@ -68,10 +68,15 @@ MathInset * MathArrayInset::clone() cons
void MathArrayInset::metrics(MathMetricsInfo & mi) const
{
- MathMetricsInfo m = mi;
- if (m.base.style == LM_ST_DISPLAY)
- m.base.style = LM_ST_TEXT;
- MathGridInset::metrics(m);
+ MathArrayChanger(mi.base);
+ MathGridInset::metrics(mi);
+}
+
+
+void MathArrayInset::draw(MathPainterInfo & pi, int x, int y) const
+{
+ MathArrayChanger(pi.base);
+ MathGridInset::draw(pi, x, y);
}
Index: math_arrayinset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_arrayinset.h,v
retrieving revision 1.19
diff -u -p -r1.19 math_arrayinset.h
--- math_arrayinset.h 11 Sep 2002 08:26:02 -0000 1.19
+++ math_arrayinset.h 1 Oct 2002 17:35:44 -0000
@@ -30,7 +30,9 @@ public:
///
MathInset * clone() const;
///
- void metrics(MathMetricsInfo & st) const;
+ void metrics(MathMetricsInfo & mi) const;
+ ///
+ void draw(MathPainterInfo & pi, int x, int y) const;
///
MathArrayInset * asArrayInset() { return this; }
///
Index: math_metricsinfo.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_metricsinfo.C,v
retrieving revision 1.12
diff -u -p -r1.12 math_metricsinfo.C
--- math_metricsinfo.C 11 Sep 2002 09:14:56 -0000 1.12
+++ math_metricsinfo.C 1 Oct 2002 17:35:44 -0000
@@ -81,6 +81,11 @@ MathFracChanger::MathFracChanger(MathMet
+MathArrayChanger::MathArrayChanger(MathMetricsBase & mb)
+ : MathStyleChanger(mb, mb.style == LM_ST_DISPLAY ? LM_ST_TEXT : mb.style)
+{}
+
+
MathShapeChanger::MathShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape)
: MathChanger<LyXFont, LyXFont::FONT_SHAPE>(font)
{
Index: math_metricsinfo.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_metricsinfo.h,v
retrieving revision 1.15
diff -u -p -r1.15 math_metricsinfo.h
--- math_metricsinfo.h 11 Sep 2002 09:14:56 -0000 1.15
+++ math_metricsinfo.h 1 Oct 2002 17:35:44 -0000
@@ -119,6 +119,13 @@ struct MathFracChanger : public MathStyl
};
+struct MathArrayChanger : public MathStyleChanger {
+ ///
+ MathArrayChanger(MathMetricsBase & mb);
+};
+
+
+
struct MathShapeChanger : public MathChanger<LyXFont, LyXFont::FONT_SHAPE> {
///
MathShapeChanger(LyXFont & font, LyXFont::FONT_SHAPE shape);