Cursor & cur = const_cast<Cursor &>(bv_->cursor());
// In some cases, we do not know how to record undo
if (&cur.inset() == &text_->inset())
- cur.recordUndo(ATOMIC_UNDO, pit, pit);
+ cur.recordUndo(pit, pit);
int const moveCursor = par.fixBiblio(buffer);
MacroContext mc(&buffer, parPos);
MetricsInfo mi(bv_, font.fontInfo(), w, mc);
ii->inset->metrics(mi, dim);
- Dimension const old_dim = pm.insetDimension(ii->inset);
+ Dimension const & old_dim = pm.insetDimension(ii->inset);
if (old_dim != dim) {
pm.setInsetDimension(ii->inset, dim);
changed = true;
/** This is the function where the hard work is done. The code here is
* very sensitive to small changes :) Note that part of the
- * intelligence is also in Row::shorten_if_needed
+ * intelligence is also in Row::shortenIfNeeded.
*/
void TextMetrics::breakRow(Row & row, int const right_margin, pit_type const pit) const
{
// if the row is too large, try to cut at last separator.
row.shortenIfNeeded(body_pos, width);
- // if the row ends with a separator that is not at end of
- // paragraph, remove it
- if (!row.empty() && row.back().type == Row::SEPARATOR
- && row.endpos() < par.size())
- row.pop_back();
-
// make sure that the RTL elements are in reverse ordering
row.reverseRTL(text_->isRTL(par));
}
l_margin += theFontMetrics(buffer.params().getFont()).signedWidth(
tclass.leftmargin());
- if (par.getDepth() != 0) {
+ int depth = par.getDepth();
+ if (depth != 0) {
// find the next level paragraph
pit_type newpar = text_->outerHook(pit);
if (newpar != pit_type(pars.size())) {
if (pars[newpar].layout().isEnvironment()) {
- l_margin = leftMargin(max_width, newpar);
+ int nestmargin = depth * nestMargin();
+ if (text_->isMainText())
+ nestmargin += changebarMargin();
+ l_margin = max(leftMargin(max_width, newpar), nestmargin);
// Remove the parindent that has been added
// if the paragraph was empty.
if (pars[newpar].empty() &&
}
if (!par.params().leftIndent().zero())
- l_margin += par.params().leftIndent().inPixels(max_width);
+ l_margin += par.params().leftIndent().inPixels(max_width, labelfont_metrics.em());
LyXAlignment align;
}
// Row signature; has row changed since last paint?
- row.setCrc(pm.computeRowSignature(row, bparams));
+ if (pi.pain.isDrawingEnabled())
+ row.setCrc(pm.computeRowSignature(row, bparams));
bool row_has_changed = row.changed()
|| rowSlice == bv_->lastRowSlice();
// Take this opportunity to spellcheck the row contents.
- if (row_has_changed && lyxrc.spellcheck_continuously) {
+ if (row_has_changed && pi.do_spellcheck && lyxrc.spellcheck_continuously) {
text_->getPar(pit).spellCheck();
}
LYXERR(Debug::PAINTING, foreword << "pit=" << pit << " row=" << i
<< " row_selection=" << row.selection()
<< " full_repaint=" << pi.full_repaint
- << " row_has_changed=" << row_has_changed);
+ << " row_has_changed=" << row_has_changed
+ << " drawingEnabled=" << pi.pain.isDrawingEnabled());
}
// Backup full_repaint status and force full repaint