return true;
}
-void setSelection(BufferView * bv, DocIterator const & from, DocIterator const & to)
-{
- DocIterator end = to;
-
- if (from.pit() != end.pit()) {
- // there are multiple paragraphs in selection
- Cursor & bvcur = bv->cursor();
- bvcur.setCursor(from);
- bvcur.clearSelection();
- bvcur.selection(true);
- bvcur.setCursor(end);
- bvcur.selection(true);
- } else {
- // FIXME LFUN
- // If we used a LFUN, dispatch would do all of this for us
- int const size = end.pos() - from.pos();
- bv->putSelectionAt(from, size, false);
- }
- bv->processUpdateFlags(Update::Force | Update::FitCursor);
-}
-
} // namespace
// restore original selection
if (had_selection) {
bv->cursor().resetAnchor();
- setSelection(bv, startcur, endcur);
+ bv->setSelection(startcur, endcur);
}
return false;
}
if (had_selection) {
endcur.fixIfBroken();
bv->cursor().resetAnchor();
- setSelection(bv, startcur, endcur);
+ bv->setSelection(startcur, endcur);
}
return num;
(( len == -1 || cs.pos() + len > int(md.size()))
? md.end()
: md.begin() + cs.pos() + len );
- MathData md2;
+ MathData md2(cur.buffer());
for (MathData::const_iterator it = md.begin() + cs.pos(); it != it_end; ++it)
md2.push_back(*it);
docstring res = from_utf8(latexNamesToUtf8(asString(md2), false));
((len == -1 || cs.pos() + len > int(md.size()))
? md.end()
: md.begin() + cs.pos() + len);
- MathData md2;
+ MathData md2(cur.buffer());
for (MathData::const_iterator it = md.begin() + cs.pos();
it != it_end; ++it)
md2.push_back(*it);
MathData md = cs.cell();
int len = -1;
MathData::const_iterator it_end = md.end();
- MathData md2;
+ MathData md2(cur.buffer());
// Start the check with one character before actual cursor position
for (MathData::const_iterator it = md.begin() + cs.pos() - 1;
it != it_end; ++it)