InsetMathFrac.cpp: add some comments and remove an unused code line

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29147 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2009-04-08 00:19:57 +00:00
parent cb0bfc9445
commit 23f833a92b

View File

@ -147,12 +147,13 @@ void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
dim.des = max(dim2.des, dim1.height() - 5); dim.des = max(dim2.des, dim1.height() - 5);
} }
} else { } else {
// general cell metrics used for \frac
FracChanger dummy(mi.base); FracChanger dummy(mi.base);
cell(0).metrics(mi, dim0); cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1); cell(1).metrics(mi, dim1);
if (nargs() == 3) if (nargs() == 3)
cell(2).metrics(mi, dim2); cell(2).metrics(mi, dim2);
// metrics for special fraction types
if (kind_ == NICEFRAC) { if (kind_ == NICEFRAC) {
dim.wid = dim0.width() + dim1.wid + 5; dim.wid = dim0.width() + dim1.wid + 5;
dim.asc = dim0.height() + 5; dim.asc = dim0.height() + 5;
@ -165,7 +166,7 @@ void InsetMathFrac::metrics(MetricsInfo & mi, Dimension & dim) const
} else { } else {
if (kind_ == CFRAC || kind_ == CFRACLEFT if (kind_ == CFRAC || kind_ == CFRACLEFT
|| kind_ == CFRACRIGHT || kind_ == DFRAC) { || kind_ == CFRACRIGHT || kind_ == DFRAC) {
// \cfrac and \dfrac are in always in display size // \cfrac and \dfrac are always in display size
StyleChanger dummy2(mi.base, LM_ST_DISPLAY); StyleChanger dummy2(mi.base, LM_ST_DISPLAY);
cell(0).metrics(mi, dim0); cell(0).metrics(mi, dim0);
cell(1).metrics(mi, dim1); cell(1).metrics(mi, dim1);
@ -189,7 +190,6 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const
setPosCache(pi, x, y); setPosCache(pi, x, y);
Dimension const dim = dimension(*pi.base.bv); Dimension const dim = dimension(*pi.base.bv);
Dimension const dim0 = cell(0).dimension(*pi.base.bv); Dimension const dim0 = cell(0).dimension(*pi.base.bv);
int m = x + dim.wid / 2;
if (kind_ == UNIT || (kind_ == UNITFRAC && nargs() == 3)) { if (kind_ == UNIT || (kind_ == UNITFRAC && nargs() == 3)) {
if (nargs() == 1) { if (nargs() == 1) {
ShapeChanger dummy2(pi.base.font, UP_SHAPE); ShapeChanger dummy2(pi.base.font, UP_SHAPE);