]> git.lyx.org Git - lyx.git/blobdiff - src/Changes.cpp
Rename frontend qt4 to qt
[lyx.git] / src / Changes.cpp
index 343af39b1e47c988c26fc55cc43dcd0f9e40720c..6e3bf0fff754a7bf24548074f33fe9f4a67d34b8 100644 (file)
@@ -382,7 +382,7 @@ docstring getLaTeXMarkup(docstring const & macro, docstring const & author,
        return ods.str();
 }
 
-} //namespace anon
+} // namespace
 
 
 int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
@@ -394,11 +394,16 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
 
        int column = 0;
 
+       bool const dvipost = LaTeXFeatures::isAvailable("dvipost") &&
+                       (runparams.flavor == OutputParams::LATEX
+                        || runparams.flavor == OutputParams::DVILUATEX);
+
        if (oldChange.type != Change::UNCHANGED) {
                // close \lyxadded or \lyxdeleted
                os << '}';
                column++;
-               if (oldChange.type == Change::DELETED && !runparams.wasDisplayMath)
+               if (oldChange.type == Change::DELETED
+                   && !runparams.wasDisplayMath && !dvipost)
                        --runparams.inulemcmd;
        }
 
@@ -410,7 +415,7 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
        docstring macro_beg;
        if (change.type == Change::DELETED) {
                macro_beg = from_ascii("\\lyxdeleted{");
-               if (!runparams.inDisplayMath)
+               if (!runparams.inDisplayMath && !dvipost)
                        ++runparams.inulemcmd;
        }
        else if (change.type == Change::INSERTED)
@@ -422,10 +427,8 @@ int Changes::latexMarkChange(otexstream & os, BufferParams const & bparams,
 
        // signature needed by \lyxsout to correctly strike out display math
        if (change.type == Change::DELETED && runparams.inDisplayMath
-           && (!LaTeXFeatures::isAvailable("dvipost")
-               || (runparams.flavor != OutputParams::LATEX
-                   && runparams.flavor != OutputParams::DVILUATEX))) {
-               if (os.afterParbreak())
+           && !dvipost) {
+               if (os.blankLine())
                        str += from_ascii("\\\\\\noindent\n");
                else
                        str += from_ascii("\\\\\\\\\n");