+ RowList::iterator rit = pit->rows.begin();
+ RowList::iterator end = pit->rows.end();
+
+ // remove rows of paragraph, keep track of height changes
+ for (int i = 0; rit != end; ++rit, ++i)
+ height -= rit->height();
+ pit->rows.clear();
+
+ // redo insets
+ InsetList::iterator ii = pit->insetlist.begin();
+ InsetList::iterator iend = pit->insetlist.end();
+ for (; ii != iend; ++ii) {
+ Dimension dim;
+ MetricsInfo mi(bv(), getFont(pit, ii->pos), workWidth());
+ ii->inset->metrics(mi, dim);
+ }
+
+ // rebreak the paragraph
+ for (pos_type z = 0; z < pit->size() + 1; ) {
+ Row row(z);
+ z = rowBreakPoint(pit, row) + 1;
+ row.end(z);
+ pit->rows.push_back(row);
+ }
+
+ int par_width = 0;
+ // set height and fill and width of rows
+ int const ww = workWidth();
+ for (rit = pit->rows.begin(); rit != end; ++rit) {
+ int const f = fill(pit, rit, ww);
+ int const w = ww - f;
+ par_width = std::max(par_width, w);
+ rit->fill(f);
+ rit->width(w);
+ prepareToPrint(pit, rit);
+ setHeightOfRow(pit, rit);
+ height += rit->height();
+ }
+
+ //lyxerr << "redoParagraph: " << pit->rows.size() << " rows\n";
+ return par_width;