From 57c37d276007d2e86254230256af27e060b7ecab Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 13 Oct 2003 10:25:44 +0000 Subject: [PATCH] =?utf8?q?Use=20Andr=EF=BF=BD's=20prefered=20idiom=20here.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7908 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 4 ++++ src/mathed/formula.C | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) 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) { -- 2.39.2