X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText2.cpp;h=96d1035243bab5915cbbda9b5e18e04ca3e3534a;hb=7d456a93e411ad5b6185d7342e213bfe442c0252;hp=c3d696e7e2ffcca53c5e71acc82fc0c13c112ed6;hpb=7e72c1d0d31c2b3155c4767f830cc861716ba357;p=lyx.git diff --git a/src/Text2.cpp b/src/Text2.cpp index c3d696e7e2..96d1035243 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -547,47 +547,23 @@ void Text::insertInset(Cursor & cur, Inset * inset) } -bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos, +bool Text::setCursor(Cursor & cur, pit_type pit, pos_type pos, bool setfont, bool boundary) { TextMetrics const & tm = cur.bv().textMetrics(this); - bool const update_needed = !tm.contains(par); + bool const update_needed = !tm.contains(pit); Cursor old = cur; - setCursorIntern(cur, par, pos, setfont, boundary); + setCursorIntern(cur, pit, pos, setfont, boundary); return cur.bv().checkDepm(cur, old) || update_needed; } -void Text::setCursor(CursorSlice & cur, pit_type par, pos_type pos) -{ - LASSERT(par != int(paragraphs().size()), return); - cur.pit() = par; - cur.pos() = pos; - - // now some strict checking - Paragraph & para = getPar(par); - - // None of these should happen, but we're scaredy-cats - if (pos < 0) { - LYXERR0("Don't like -1!"); - LATTEST(false); - } - - if (pos > para.size()) { - LYXERR0("Don't like 1, pos: " << pos - << " size: " << para.size() - << " par: " << par); - LATTEST(false); - } -} - - -void Text::setCursorIntern(Cursor & cur, - pit_type par, pos_type pos, bool setfont, bool boundary) +void Text::setCursorIntern(Cursor & cur, pit_type pit, pos_type pos, + bool setfont, bool boundary) { LBUFERR(this == cur.text()); cur.boundary(boundary); - setCursor(cur.top(), par, pos); + cur.top().setPitPos(pit, pos); if (setfont) cur.setCurrentFont(); }