bool TextMetrics::redoParagraph(pit_type const pit)
{
+ Paragraph & par = text_->getPar(pit);
// IMPORTANT NOTE: We pass 'false' explicitely in order to not call
// redoParagraph() recursively inside parMetrics.
Dimension old_dim = parMetrics(pit, false).dim();
ParagraphMetrics & pm = par_metrics_[pit];
- // reinitialize paragraph dimension.
- pm.dim() = Dimension();
- Paragraph & par = text_->getPar(pit);
+ pm.reset(par);
+
Buffer & buffer = bv_->buffer();
main_text_ = (text_ == &buffer.text());
bool changed = false;
InsetList::const_iterator ii = par.insetlist.begin();
InsetList::const_iterator iend = par.insetlist.end();
for (; ii != iend; ++ii) {
+ Dimension old_dim = ii->inset->dimension();
Dimension dim;
int const w = max_width_ - text_->leftMargin(buffer, max_width_, pit, ii->pos)
- right_margin;
Font const & font = ii->inset->noFontChange() ?
bufferfont : text_->getFont(buffer, par, ii->pos);
MetricsInfo mi(bv_, font, w);
- changed |= ii->inset->metrics(mi, dim);
+ ii->inset->metrics(mi, dim);
+ changed |= (old_dim != dim);
}
- // rebreak the paragraph
- pm.rows().clear();
-
par.setBeginOfBody();
pos_type z = 0;
// maximum pixel width of a row
result.x = text_->leftMargin(buffer, max_width_, pit, row.pos());
// is there a manual margin with a manual label
- Layout_ptr const & layout = par.layout();
+ LayoutPtr const & layout = par.layout();
if (layout->margintype == MARGIN_MANUAL
&& layout->labeltype == LABEL_MANUAL) {
return;
}
- Layout_ptr const & layout = par.layout();
+ LayoutPtr const & layout = par.layout();
if (layout->margintype == MARGIN_RIGHT_ADDRESS_BOX) {
row.endpos(addressBreakPoint(pos, par));
// ok, let us initialize the maxasc and maxdesc value.
// Only the fontsize count. The other properties
// are taken from the layoutfont. Nicer on the screen :)
- Layout_ptr const & layout = par.layout();
+ LayoutPtr const & layout = par.layout();
// as max get the first character of this row then it can
// increase but not decrease the height. Just some point to
pos_type vc = row.pos();
pos_type end = row.endpos();
pos_type c = 0;
- Layout_ptr const & layout = par.layout();
+ LayoutPtr const & layout = par.layout();
bool left_side = false;