tiny optimisation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16656 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-01-11 22:38:00 +00:00
parent fc3a2761de
commit 7317e80b1f

View File

@ -707,12 +707,14 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
// environment. // environment.
pit_type prev = depthHook(pit, pars, par.getDepth()); pit_type prev = depthHook(pit, pars, par.getDepth());
if (prev != pit if (prev != pit) {
&& pars[prev].layout() == layout Paragraph const & prevpar = pars[prev];
&& pars[prev].getDepth() == par.getDepth() if (prevpar.layout() == layout
&& pars[prev].getLabelWidthString() == par.getLabelWidthString()) && prevpar.getDepth() == par.getDepth()
{ && prevpar.getLabelWidthString()
layoutasc = layout->itemsep * dh; == par.getLabelWidthString()) {
layoutasc = layout->itemsep * dh;
}
} else if (pit != 0 || row.pos() != 0) { } else if (pit != 0 || row.pos() != 0) {
if (layout->topsep > 0) if (layout->topsep > 0)
layoutasc = layout->topsep * dh; layoutasc = layout->topsep * dh;
@ -722,8 +724,9 @@ void TextMetrics::setHeightOfRow(pit_type const pit,
if (prev != pit_type(pars.size())) { if (prev != pit_type(pars.size())) {
maxasc += int(pars[prev].layout()->parsep * dh); maxasc += int(pars[prev].layout()->parsep * dh);
} else if (pit != 0) { } else if (pit != 0) {
if (pars[pit - 1].getDepth() != 0 || Paragraph const & prevpar = pars[pit - 1];
pars[pit - 1].layout() == layout) { if (prevpar.getDepth() != 0 ||
prevpar.layout() == layout) {
maxasc += int(layout->parsep * dh); maxasc += int(layout->parsep * dh);
} }
} }