]> git.lyx.org Git - features.git/commitdiff
Fix bug #11398
authorEnrico Forestieri <forenr@lyx.org>
Sun, 2 Dec 2018 17:27:38 +0000 (18:27 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:51 +0000 (14:39 +0200)
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.

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 c160daa4ab5476df899bfc8f7b59fe098e68adc6..9d92681dd20ccd021d354ee7406c068dfb24dd45 100644 (file)
@@ -447,10 +447,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');
 }