if (added_one) {
// Warn the user.
docstring const s = bformat(_("Layout `%1$s' was not found."), layoutname);
- errorList.push_back(
- ErrorItem(_("Layout Not Found"), s, par.id(), 0, par.size()));
+ errorList.push_back(ErrorItem(_("Layout Not Found"), s,
+ {par.id(), 0}, {par.id(), -1}));
}
par.setLayout(bp.documentClass()[layoutname]);
lex.eatLine();
docstring line = lex.getDocString();
errorList.push_back(ErrorItem(_("Unknown Inset"), line,
- par.id(), 0, par.size()));
+ {par.id(), 0}, {par.id(), -1}));
}
} else if (token == "\\family") {
lex.next();
"missing until the corresponding tracked changes "
"are merged or this user edits the file again.\n"),
aid),
- par.id(), par.size(), par.size() + 1
- ));
+ {par.id(), par.size()}, {par.id(), par.size() + 1}));
bp.addAuthor(Author(aid));
}
if (token == "\\change_inserted")
} else {
lex.eatLine();
errorList.push_back(ErrorItem(_("Unknown token"),
- bformat(_("Unknown token: %1$s %2$s\n"), from_utf8(token),
- lex.getDocString()),
- par.id(), 0, par.size()));
+ bformat(_("Unknown token: %1$s %2$s\n"),
+ from_utf8(token),
+ lex.getDocString()),
+ {par.id(), 0}, {par.id(), -1}));
}
}
{
public:
///
- TextCompletionList(Cursor const & cur, WordList const * list)
+ TextCompletionList(Cursor const & cur, WordList const & list)
: buffer_(cur.buffer()), list_(list)
{}
///
///
virtual size_t size() const
{
- return list_->size();
+ return list_.size();
}
///
virtual docstring const & data(size_t idx) const
{
- return list_->word(idx);
+ return list_.word(idx);
}
private:
///
Buffer const * buffer_;
///
- WordList const * list_;
+ WordList const & list_;
};
Layout const & layout = cpar.layout();
if (cur.lastpos() == 0 && !cpar.allowEmpty()) {
- if (changeDepthAllowed(cur, DEC_DEPTH))
+ if (changeDepthAllowed(cur, DEC_DEPTH)) {
changeDepth(cur, DEC_DEPTH);
- else {
+ pit_type const prev = depthHook(cpit, cpar.getDepth());
+ docstring const & lay = pars_[prev].layout().name();
+ if (lay != layout.name())
+ setLayout(cur, lay);
+ } else {
docstring const & lay = cur.paragraph().usePlainLayout()
? tclass.plainLayoutName() : tclass.defaultLayoutName();
if (lay != layout.name())
CompletionList const * Text::createCompletionList(Cursor const & cur) const
{
- WordList const * list = theWordList(cur.getFont().language()->lang());
+ WordList const & list = theWordList(cur.getFont().language()->lang());
return new TextCompletionList(cur, list);
}