From a061ea31ea43121eff4c10c1eef3e57455400bbd Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 1 Oct 2007 09:54:41 +0000 Subject: [PATCH] Fix some assertions. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20628 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathFrac.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 896d0a2475..1babb9768e 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -140,8 +140,6 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const setPosCache(pi, x, y); Dimension const dim = dimension(*pi.base.bv); Dimension const dim0 = cell(0).dimension(*pi.base.bv); - Dimension const dim1 = cell(1).dimension(*pi.base.bv); - Dimension const dim2 = cell(2).dimension(*pi.base.bv); int m = x + dim.wid / 2; if (kind_ == UNIT || (kind_ == UNITFRAC && nargs() == 3)) { if (nargs() == 1) { @@ -155,6 +153,8 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const cell(2).draw(pi, x + 1, y); ShapeChanger dummy2(pi.base.font, Font::UP_SHAPE); FracChanger dummy(pi.base); + Dimension const dim1 = cell(1).dimension(*pi.base.bv); + Dimension const dim2 = cell(2).dimension(*pi.base.bv); int xx = x + dim2.wid + 5; cell(0).draw(pi, xx + 2, y - dim0.des - 5); @@ -163,6 +163,7 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const } } else { FracChanger dummy(pi.base); + Dimension const dim1 = cell(1).dimension(*pi.base.bv); if (kind_ == NICEFRAC) { cell(0).draw(pi, x + 2, y - dim0.des - 5); @@ -185,6 +186,7 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const if (kind_ == NICEFRAC || kind_ == UNITFRAC) { // Diag line: int xx = x; + Dimension const dim2 = cell(2).dimension(*pi.base.bv); if (nargs() == 3) xx += dim2.wid + 5; pi.pain.line(xx + dim0.wid,