]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #11398
authorEnrico Forestieri <forenr@lyx.org>
Sun, 2 Dec 2018 17:27:38 +0000 (18:27 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 8 Dec 2018 22:09:38 +0000 (23:09 +0100)
When deciding how to strike out deleted math in change-tracking
mode, differentiate only on begin-of-line or not, and not on
after-paragraph-break or not.

The assumption that a new paragraph is always started after a
float seems to be not true and was causing this bug.

(cherry picked from commit bd21aa99d244cbfe532c4d970197a940355828dd)

src/Changes.cpp
src/insets/InsetFloat.cpp

index b4226582f4f7b97e88323607223f9f691c005178..5f8e3b21bf2af4dab62099d7a4c92f6dceaf5c8f 100644 (file)
@@ -428,7 +428,7 @@ 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
            && !dvipost) {
-               if (os.afterParbreak())
+               if (os.lastChar() == '\n')
                        str += from_ascii("\\\\\\noindent\n");
                else
                        str += from_ascii("\\\\\\\\\n");
index 50fd544c4a7919854ccfda963779723142e2e7b0..021b7f3b17e805d6e05e5e72d1ab9cf5c102f875 100644 (file)
@@ -402,10 +402,6 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const
 
        // Force \end{<floatname>} to appear in a new line.
        os << breakln << "\\end{" << from_ascii(tmptype) << "}\n";
-
-       // A new paragraph is always started after a float. Hence, simulate a
-       // blank line so that os.afterParbreak() returns true (see bug 11174).
-       os.lastChar('\n');
 }