}
-docstring CursorData::selectionAsString(bool with_label) const
+docstring CursorData::selectionAsString(bool const with_label, bool const skipdelete) const
{
if (!selection())
return docstring();
if (inMathed())
return cap::grabSelection(*this);
- int const label = with_label
+ int label = with_label
? AS_STR_LABEL | AS_STR_INSETS : AS_STR_INSETS;
+ if (skipdelete)
+ label = with_label
+ ? AS_STR_LABEL | AS_STR_INSETS | AS_STR_SKIPDELETE
+ : AS_STR_INSETS | AS_STR_SKIPDELETE;
idx_type const startidx = selBegin().idx();
idx_type const endidx = selEnd().idx();
DocIterator selectionEnd() const;
///
- docstring selectionAsString(bool with_label) const;
+ docstring selectionAsString(bool const with_label,
+ bool const skipdelete = false) const;
/// get some interesting description of top position
void info(odocstream & os, bool devel_mode) const;
///
// Even if there is no selection.
if (putclip)
putClipboard(cuts[0].first, cuts[0].second,
- cur.selectionAsString(true));
+ cur.selectionAsString(true, true));
}
if (begpit != endpit)
void copySelection(Cursor const & cur)
{
- copySelection(cur, cur.selectionAsString(true));
+ copySelection(cur, cur.selectionAsString(true, true));
}
if (cur.selection()
&& cur.selBegin() == cur.bv().cursor().selBegin()
&& cur.selEnd() == cur.bv().cursor().selEnd()) {
- LYXERR(Debug::SELECTION, "saveSelection: '" << cur.selectionAsString(true) << "'");
+ LYXERR(Debug::SELECTION, "saveSelection: '" << cur.selectionAsString(true, true) << "'");
copySelectionToStack(cur, selectionBuffer);
}
}