From: Angus Leeming Date: Mon, 13 Oct 2003 10:25:44 +0000 (+0000) Subject: Use Andr�'s prefered idiom here. X-Git-Tag: 1.6.10~15958 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=57c37d276007d2e86254230256af27e060b7ecab;p=features.git Use Andr�'s prefered idiom here. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7908 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index a056f31b62..c8593558b2 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,7 @@ +2003-10-13 Angus Leeming + + * formula.C (editing_inset): pass a pointer rather than a reference. + 2003-10-13 Angus Leeming * formula.C: remove #include "PreviewImage.h". diff --git a/src/mathed/formula.C b/src/mathed/formula.C index bafa9a967a..932d9ac695 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -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(&inset)); + return mathcursor && + (const_cast(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) {