]> git.lyx.org Git - features.git/commitdiff
Use Andr�'s prefered idiom here.
authorAngus Leeming <leeming@lyx.org>
Mon, 13 Oct 2003 10:25:44 +0000 (10:25 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 13 Oct 2003 10:25:44 +0000 (10:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7908 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/formula.C

index a056f31b62b63c691038b89212ad832efd92bcb1..c8593558b2f916cadaa1e7fee04013cf75430829 100644 (file)
@@ -1,3 +1,7 @@
+2003-10-13  Angus Leeming  <leeming@lyx.org>
+
+       * formula.C (editing_inset): pass a pointer rather than a reference. 
+
 2003-10-13  Angus Leeming  <leeming@lyx.org>
 
        * formula.C: remove #include "PreviewImage.h".
index bafa9a967a56c6f9a335e6a04c4e0b54481a72c7..932d9ac69519e8b9375e4848615c8b3954553d79 100644 (file)
@@ -179,10 +179,11 @@ void InsetFormula::read(Buffer const &, LyXLex & lex)
 
 namespace {
 
-bool editing_inset(InsetFormula const & inset)
+bool editing_inset(InsetFormula const * inset)
 {
-       return (mathcursor &&
-               mathcursor->formula() == const_cast<InsetFormula *>(&inset));
+       return mathcursor &&
+               (const_cast<InsetFormulaBase const *>(mathcursor->formula()) ==
+                inset);
 }
 
 } // namespace anon
@@ -193,7 +194,7 @@ void InsetFormula::draw(PainterInfo & pi, int x, int y) const
        cache(pi.base.bv);
 
        // The previews are drawn only when we're not editing the inset.
-       bool const use_preview = (!editing_inset(*this) &&
+       bool const use_preview = (!editing_inset(this) &&
                                  preview_->previewReady());
 
        int const w = dim_.wid;
@@ -213,7 +214,7 @@ void InsetFormula::draw(PainterInfo & pi, int x, int y) const
                            != lcolor.getX11Name(LColor::background))
                        p.pain.fillRectangle(x, y - a, w, h, LColor::mathbg);
 
-               if (editing_inset(*this)) {
+               if (editing_inset(this)) {
                        mathcursor->drawSelection(pi);
                        //p.pain.rectangle(x, y - a, w, h, LColor::mathframe);
                }
@@ -256,7 +257,7 @@ bool InsetFormula::insetAllowed(InsetOld::Code code) const
 
 void InsetFormula::metrics(MetricsInfo & m, Dimension & dim) const
 {
-       bool const use_preview = (!editing_inset(*this) &&
+       bool const use_preview = (!editing_inset(this) &&
                                  preview_->previewReady());
 
        if (use_preview) {