mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 13:04:58 +00:00
parent
affc006bae
commit
11c47ddfcf
@ -347,7 +347,7 @@ docstring parbreak(CursorData const * cur)
|
||||
}
|
||||
|
||||
|
||||
docstring CursorData::selectionAsString(bool with_label) const
|
||||
docstring CursorData::selectionAsString(bool const with_label, bool const skipdelete) const
|
||||
{
|
||||
if (!selection())
|
||||
return docstring();
|
||||
@ -355,8 +355,12 @@ docstring CursorData::selectionAsString(bool with_label) const
|
||||
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();
|
||||
|
@ -154,7 +154,8 @@ public:
|
||||
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;
|
||||
///
|
||||
|
@ -950,7 +950,7 @@ void cutSelectionHelper(Cursor & cur, CutStack & cuts, bool realcut, bool putcli
|
||||
// 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)
|
||||
@ -1011,7 +1011,7 @@ void cutSelectionToTemp(Cursor & cur, bool realcut)
|
||||
|
||||
void copySelection(Cursor const & cur)
|
||||
{
|
||||
copySelection(cur, cur.selectionAsString(true));
|
||||
copySelection(cur, cur.selectionAsString(true, true));
|
||||
}
|
||||
|
||||
|
||||
@ -1122,7 +1122,7 @@ void saveSelection(Cursor const & cur)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user