int numberOfHfills(Paragraph const & par, Row const & row)
{
- pos_type last = row.endpos();
+ pos_type const last = row.endpos();
pos_type first = row.pos();
- pos_type const par_size = par.size();
// hfill *DO* count at the beginning of paragraphs!
if (first) {
- while (first < last && first < par_size && par.isHfill(first))
+ while (first < last && par.isHfill(first))
++first;
}
first = max(first, par.beginOfBody());
- last = min(last, par_size);
int n = 0;
for (pos_type p = first; p < last; ++p) {
par_metrics_[pit] = pm;
+ // Update the row change statuses. The painter will need that info
+ // in order to know which row has to be repainted.
+ par_metrics_[pit].updateRowChangeStatus();
+
return changed;
}
// environment.
pit_type prev = depthHook(pit, pars, par.getDepth());
+ Paragraph const & prevpar = pars[prev];
if (prev != pit
- && pars[prev].layout() == layout
- && pars[prev].getDepth() == par.getDepth()
- && pars[prev].getLabelWidthString() == par.getLabelWidthString())
- {
+ && prevpar.layout() == layout
+ && prevpar.getDepth() == par.getDepth()
+ && prevpar.getLabelWidthString()
+ == par.getLabelWidthString()) {
layoutasc = layout->itemsep * dh;
} else if (pit != 0 || row.pos() != 0) {
if (layout->topsep > 0)
if (prev != pit_type(pars.size())) {
maxasc += int(pars[prev].layout()->parsep * dh);
} else if (pit != 0) {
- if (pars[pit - 1].getDepth() != 0 ||
- pars[pit - 1].layout() == layout) {
+ Paragraph const & prevpar = pars[pit - 1];
+ if (prevpar.getDepth() != 0 ||
+ prevpar.layout() == layout) {
maxasc += int(layout->parsep * dh);
}
}