]> git.lyx.org Git - lyx.git/blobdiff - src/Font.cpp
Make undo action no-ops when the buffer is read-only
[lyx.git] / src / Font.cpp
index b70c237db4d14498f798ea42e60c2a2036b9400d..3ba04eba4756f9a6f2fcdccce2cf766433181db2 100644 (file)
@@ -399,10 +399,6 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
                        os << '}';
                        ++count;
                } else if (f.color() != Color_none) {
-                       if (needs_cprotection) {
-                               os << "\\cprotect";
-                               count += 9;
-                       }
                        os << "\\textcolor{"
                           << from_ascii(lcolor.getLaTeXName(f.color()))
                           << "}{";
@@ -635,7 +631,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
                bool const using_begin_end =
                        runparams.use_polyglossia ||
                                !lyxrc.language_command_end.empty();
-               if (using_begin_end)
+               if (using_begin_end && !languageStackEmpty())
                        popLanguageName();
        }