X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursor.cpp;h=97d497209e9d8839db17bc5e08dd5a4336975a22;hb=11c47ddfcfa8c83fd24b1e7e47279db32f1be9cd;hp=431aa16c5aafc9ccba35873d970ffd6637b102f1;hpb=affc006baeb50c3d730ac06cf6dcfe050d6c98d8;p=features.git diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 431aa16c5a..97d497209e 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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();