namespace {
-void cutSelectionHelper(Cursor & cur, CutStack & cuts, bool doclear, bool realcut, bool putclip)
+void cutSelectionHelper(Cursor & cur, CutStack & cuts, bool realcut, bool putclip)
{
// This doesn't make sense, if there is no selection
if (!cur.selection())
cur.pos() = endpos;
cur.pit() = endpit;
- // sometimes necessary
- if (doclear
- && text->paragraphs()[begpit].stripLeadingSpaces(bp.track_changes))
- cur.fixIfBroken();
-
// need a valid cursor. (Lgb)
cur.clearSelection();
} // namespace
-void cutSelection(Cursor & cur, bool doclear, bool realcut)
+void cutSelection(Cursor & cur, bool realcut)
{
- cutSelectionHelper(cur, theCuts, doclear, realcut, true);
+ cutSelectionHelper(cur, theCuts, realcut, true);
}
-void cutSelectionToTemp(Cursor & cur, bool doclear, bool realcut)
+void cutSelectionToTemp(Cursor & cur, bool realcut)
{
- cutSelectionHelper(cur, tempCut, doclear, realcut, false);
+ cutSelectionHelper(cur, tempCut, realcut, false);
}
return;
cur.recordUndo();
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
if (asParagraphs)
cur.text()->insertStringAsParagraphs(cur, text, cur.current_font);
else
par.insertChar(pos, *cit, font, cur.buffer()->params().track_changes);
// Cut the selection
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
}
void replaceSelection(Cursor & cur)
{
if (cur.selection())
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
}
* system clipboard. Set this to false to only delete the
* selection.
*/
-void cutSelection(Cursor & cur, bool doclear = true, bool realcut = true);
+void cutSelection(Cursor & cur, bool realcut = true);
/// Like cutSelection, but only put to temporary cut buffer
-void cutSelectionToTemp(Cursor & cur, bool doclear = true, bool realcut = true);
+void cutSelectionToTemp(Cursor & cur, bool realcut = true);
/// Push the current selection to the cut buffer and the system clipboard.
void copySelection(Cursor const & cur);
cursorForwardOneWord(cur);
cur.setSelection();
if (force || !cur.confirmDeletion()) {
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
cur.checkBufferStructure();
}
}
cursorBackwardOneWord(cur);
cur.setSelection();
if (force || !cur.confirmDeletion()) {
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
cur.checkBufferStructure();
}
}
if (cmd.action() == LFUN_INDEX_INSERT)
copySelectionToTemp(cur);
else
- cutSelectionToTemp(cur, false, pastesel);
+ cutSelectionToTemp(cur, pastesel);
cur.clearSelection();
gotsel = true;
} else if (cmd.action() == LFUN_INDEX_INSERT) {
case LFUN_WORD_DELETE_FORWARD:
if (cur.selection())
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
else
deleteWordForward(cur, cmd.getArg(0) == "force");
finishChange(cur, false);
case LFUN_WORD_DELETE_BACKWARD:
if (cur.selection())
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
else
deleteWordBackward(cur, cmd.getArg(0) == "force");
finishChange(cur, false);
case LFUN_LINE_DELETE_FORWARD:
if (cur.selection())
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
else
tm->deleteLineForward(cur);
finishChange(cur, false);
needsUpdate |= erase(cur);
cur.resetAnchor();
} else {
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
singleParUpdate = false;
}
moveCursor(cur, false);
}
}
} else {
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
singleParUpdate = false;
}
break;
}
*/
if (cur.selection())
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
cur.insert(inset);
cur.forceBufferUpdate();
if (inset->editable() && inset->asInsetText())
}
case LFUN_CUT:
- cutSelection(cur, true, true);
+ cutSelection(cur, true);
cur.message(_("Cut"));
break;
// true (on).
if (lyxrc.auto_region_delete && cur.selection())
- cutSelection(cur, false, false);
+ cutSelection(cur, false);
cur.clearSelection();
for (char_type c : cmd.argument())
if (cmd.argument().empty() && cur.selection()) {
// if command argument is empty use current selection as parameter.
docstring ds = cur.selectionAsString(false);
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
FuncRequest cmd0(cmd, ds);
inset = createInset(cur.buffer(), cmd0);
} else {
if (tclass.floats().typeExist(to_utf8(cmd.argument()))) {
cur.recordUndo();
if (cur.selection())
- cutSelection(cur, true, false);
+ cutSelection(cur, false);
breakParagraph(cur);
if (cur.lastpos() != 0) {
if (!cur.selection())
text_->deleteWordForward(cur);
else
- cap::cutSelection(cur, true, false);
+ cap::cutSelection(cur, false);
cur.checkBufferStructure();
}
}
changeFirstCase(repl_buffer, text_uppercase, text_uppercase);
}
}
- cap::cutSelection(cur, false, false);
+ cap::cutSelection(cur, false);
if (cur.inTexted()) {
repl_buffer.changeLanguage(
repl_buffer.language(),
case LFUN_CUT:
cur.recordUndo();
- cutSelection(cur, true, true);
+ cutSelection(cur, true);
cur.message(_("Cut"));
// Prevent stale position >= size crash
// Probably not necessary anymore, see eraseSelection (gb 2005-10-09)