X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCursor.cpp;h=41cf26ec1758fa0b1caa72d2994616f03aba556a;hb=7441172d4d9a26eb4824bb8bee003f457ef34f1c;hp=947eeb1d536dd9141a9b59dfe74ce0a6d5677656;hpb=6f8298b1658106c6536a6532af27822e74d41649;p=lyx.git diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 947eeb1d53..41cf26ec17 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(); @@ -1835,13 +1839,13 @@ bool Cursor::inMacroMode() const InsetMathUnknown * Cursor::activeMacro() { - return inMacroMode() ? prevAtom().nucleus()->asUnknownInset() : 0; + return inMacroMode() ? prevAtom().nucleus()->asUnknownInset() : nullptr; } InsetMathUnknown const * Cursor::activeMacro() const { - return inMacroMode() ? prevAtom().nucleus()->asUnknownInset() : 0; + return inMacroMode() ? prevAtom().nucleus()->asUnknownInset() : nullptr; } @@ -2401,6 +2405,8 @@ bool notifyCursorLeavesOrEnters(Cursor const & old, Cursor & cur) void Cursor::setLanguageFromInput() { + if (!lyxrc.respect_os_kbd_language) + return; string const & code = theApp()->inputLanguageCode(); Language const * lang = languages.getFromCode(code, buffer()->getLanguages()); if (lang) { @@ -2468,12 +2474,6 @@ void Cursor::checkBufferStructure() // In case the master has no gui associated with it, // the TocItem is not updated (part of bug 5699). buffer()->tocBackend().updateItem(*this); - - // If the last tracked change of the paragraph has just been - // deleted, then we need to recompute the buffer flag - // tracked_changes_present_. - if (inTexted() && paragraph().isChangeUpdateRequired()) - disp_.forceChangesUpdate(); }