void moveCursor(BufferView * bv, bool selecting)
{
- LyXText * lt = bv->getLyXText();
-
if (selecting || bv->selection().mark())
- lt->setSelection();
+ bv->setSelection();
if (!bv->selection().set())
bv->haveSelection(false);
void LyXText::gotoInset(vector<InsetOld::Code> const & codes,
bool same_content)
{
- clearSelection();
+ bv()->clearSelection();
string contents;
if (same_content && cursor().pos() < cursorPar()->size()
}
case LFUN_DELETE_WORD_FORWARD:
- clearSelection();
+ bv->clearSelection();
deleteWordForward();
finishChange(bv);
break;
case LFUN_DELETE_WORD_BACKWARD:
- clearSelection();
+ bv->clearSelection();
deleteWordBackward();
finishChange(bv);
break;
case LFUN_DELETE_LINE_FORWARD:
- clearSelection();
+ bv->clearSelection();
deleteLineForward();
finishChange(bv);
break;
case LFUN_WORDRIGHT:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
if (rtl())
cursorLeftOneWord();
else
case LFUN_WORDLEFT:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
if (rtl())
cursorRightOneWord();
else
case LFUN_BEGINNINGBUF:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
cursorTop();
finishChange(bv);
break;
case LFUN_ENDBUF:
if (bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
cursorBottom();
finishChange(bv);
break;
case LFUN_UP_PARAGRAPH:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
cursorUpParagraph();
finishChange(bv);
break;
case LFUN_DOWN_PARAGRAPH:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
cursorDownParagraph();
finishChange(bv, false);
break;
case LFUN_PRIOR:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
finishChange(bv, false);
if (cursorPar() == firstPar() && cursorRow() == firstRow())
return DispatchResult(false, FINISHED_UP);
case LFUN_NEXT:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
finishChange(bv, false);
if (cursorPar() == lastPar() && cursorRow() == lastRow())
return DispatchResult(false, FINISHED_DOWN);
case LFUN_HOME:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
cursorHome();
finishChange(bv, false);
break;
case LFUN_END:
if (!bv->selection().mark())
- clearSelection();
+ bv->clearSelection();
cursorEnd();
finishChange(bv, false);
break;
break;
case LFUN_INSET_TOGGLE:
- clearSelection();
+ bv->clearSelection();
if (!toggleInset())
return DispatchResult(false);
bv->update();
specialChar(this, bv, InsetSpecialChar::MENU_SEPARATOR);
break;
- case LFUN_MARK_OFF:
- clearSelection();
- bv->update();
- bv->resetAnchor();
- cmd.message(N_("Mark off"));
- break;
-
- case LFUN_MARK_ON:
- clearSelection();
- bv->selection().mark(true);
- bv->update();
- bv->resetAnchor();
- cmd.message(N_("Mark on"));
- break;
-
- case LFUN_SETMARK:
- clearSelection();
- if (bv->selection().mark()) {
- cmd.message(N_("Mark removed"));
- } else {
- bv->selection().mark(true);
- cmd.message(N_("Mark set"));
- }
- bv->resetAnchor();
- bv->update();
- break;
-
case LFUN_UPCASE_WORD:
changeCase(LyXText::text_uppercase);
bv->update();
pasteSelection(strToUnsignedInt(cmd.argument));
else
pasteSelection(0);
- clearSelection(); // bug 393
+ bv->clearSelection(); // bug 393
bv->update();
bv->switchKeyMap();
finishUndo();
}
case LFUN_PASTESELECTION: {
- // this was originally a bv->text->clearSelection(), i.e
- // the outermost LyXText!
- clearSelection();
+ bv->clearSelection();
string const clip = bv->getClipboard();
if (!clip.empty()) {
if (cmd.argument == "paragraph")
cursorHome();
bv->resetAnchor();
cursorEnd();
- setSelection();
+ bv->setSelection();
bv->haveSelection(bv->selection().set());
}
break;
else if (cmd.y - bv->top_y() < 0)
cursorUp(true);
}
- setSelection();
+ bv->setSelection();
break;
}
selection_possible = true;
// Clear the selection
- clearSelection();
+ bv->clearSelection();
// Right click on a footnote flag opens float menu
if (cmd.button() == mouse_button::button3) {
bv->haveSelection(false);
}
- clearSelection();
+ bv->clearSelection();
LyXFont const old_font = real_current_font;
string::const_iterator cit = cmd.argument.begin();