if (pit() + 1 >= int(text()->paragraphs().size()) &&
row + 1 >= int(pm.rows().size()))
return false;
- }
+ }
// with and without selection are handled differently
if (!selection()) {
top().pos() = min(tm.x2pos(pit(), row - 1, xo), top().lastpos());
} else if (pit() > 0) {
--pit();
- ParagraphMetrics const & pmcur = bv_->parMetrics(text(), pit());
+ TextMetrics & tm = bv_->textMetrics(text());
+ if (!tm.contains(pit()))
+ tm.newParMetricsUp();
+ ParagraphMetrics const & pmcur = tm.parMetrics(pit());
top().pos() = min(tm.x2pos(pit(), pmcur.rows().size() - 1, xo), top().lastpos());
}
} else {
top().pos() = min(tm.x2pos(pit(), row + 1, xo), top().lastpos());
} else if (pit() + 1 < int(text()->paragraphs().size())) {
++pit();
+ TextMetrics & tm = bv_->textMetrics(text());
+ if (!tm.contains(pit()))
+ tm.newParMetricsDown();
top().pos() = min(tm.x2pos(pit(), 0, xo), top().lastpos());
}
}
void Cursor::checkBufferStructure()
{
- if (paragraph().layout()->toclevel == Layout::NOT_IN_TOC)
+ if (paragraph().layout().toclevel == Layout::NOT_IN_TOC)
return;
Buffer const * master = buffer().masterBuffer();
master->tocBackend().updateItem(ParConstIterator(*this));