void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
- docstring const & layout)
+ docstring const & layout)
{
LASSERT(start != end, /**/);
- BufferParams const & bufparams = buffer.params();
- Layout const & lyxlayout = bufparams.documentClass()[layout];
+ BufferParams const & bp = buffer.params();
+ Layout const & lyxlayout = bp.documentClass()[layout];
for (pit_type pit = start; pit != end; ++pit) {
Paragraph & par = pars_[pit];
par.applyLayout(lyxlayout);
if (lyxlayout.margintype == MARGIN_MANUAL)
- par.setLabelWidthString(par.translateIfPossible(
- lyxlayout.labelstring(), buffer.params()));
+ par.setLabelWidthString(par.expandLabel(lyxlayout, bp));
}
}
// Try implicit word selection
// If there is a change in the language the implicit word selection
// is disabled.
- CursorSlice resetCursor = cur.top();
- bool implicitSelection =
+ CursorSlice const resetCursor = cur.top();
+ bool const implicitSelection =
font.language() == ignore_language
&& font.fontInfo().number() == FONT_IGNORE
&& selectWordWhenUnderCursor(cur, WHOLE_WORD_STRICT);
//FIXME UNICODE
string const argument = to_utf8(arg);
+ depth_type priordepth = -1;
+ Layout priorlayout;
for (pit_type pit = cur.selBegin().pit(), end = cur.selEnd().pit();
pit <= end; ++pit) {
Paragraph & par = pars_[pit];
ParagraphParameters params = par.params();
params.read(argument, merge);
+ // Changes to label width string apply to all paragraphs
+ // with same layout in a sequence.
+ // Do this only once for a selected range of paragraphs
+ // of the same layout and depth.
+ if (par.getDepth() != priordepth || par.layout() != priorlayout)
+ setLabelWidthStringToSequence(pit, pars_,
+ params.labelWidthString());
par.params().apply(params, par.layout());
+ priordepth = par.getDepth();
+ priorlayout = par.layout();
}
}
pit_type undopit = undoSpan(cur.selEnd().pit());
recUndo(cur, cur.selBegin().pit(), undopit - 1);
+ depth_type priordepth = -1;
+ Layout priorlayout;
for (pit_type pit = cur.selBegin().pit(), end = cur.selEnd().pit();
pit <= end; ++pit) {
Paragraph & par = pars_[pit];
+ // Changes to label width string apply to all paragraphs
+ // with same layout in a sequence.
+ // Do this only once for a selected range of paragraphs
+ // of the same layout and depth.
+ if (par.getDepth() != priordepth || par.layout() != priorlayout)
+ setLabelWidthStringToSequence(pit, pars_,
+ par.params().labelWidthString());
par.params().apply(p, par.layout());
- }
+ priordepth = par.getDepth();
+ priorlayout = par.layout();
+ }
}
if (!front && cur.pos() == 0)
return false;
Inset * inset = front ? cur.nextInset() : cur.prevInset();
- if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE)
+ if (!inset || !inset->editable())
return false;
/*
* Apparently, when entering an inset we are expected to be positioned
return false;
Paragraph & par = cur.paragraph();
Inset * inset = par.isInset(cur.pos()) ? par.getInset(cur.pos()) : 0;
- if (!inset || inset->editable() != Inset::HIGHLY_EDITABLE)
+ if (!inset || !inset->editable())
return false;
inset->edit(cur, movingForward,
movingLeft ? Inset::ENTRY_DIRECTION_RIGHT : Inset::ENTRY_DIRECTION_LEFT);