]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Assure correct spacing of colored items in mathed
[lyx.git] / src / Cursor.cpp
index 947eeb1d536dd9141a9b59dfe74ce0a6d5677656..41cf26ec1758fa0b1caa72d2994616f03aba556a 100644 (file)
@@ -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();
 }