]> git.lyx.org Git - lyx.git/commitdiff
Amend bd21aa9
authorEnrico Forestieri <forenr@lyx.org>
Thu, 6 Dec 2018 09:30:58 +0000 (10:30 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 8 Dec 2018 22:16:08 +0000 (23:16 +0100)
Check whether a line is actually blank rather than whether
we are at the beginning of a line.

(cherry picked from commit 976e0b79933e162070ef3d2973fb0c899f8bdf54)

ANNOUNCE
src/Changes.cpp
src/texstream.h

index 2b9171b2b1820264ca20aadac0d94811bf6ae646..f9f8e964a4d975bb088561fbfaf09c1f19a94765 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -164,6 +164,8 @@ What's new
 
 - Fix loading order conflict with beamer-article and covington.
 
+- Preserve a new paragraph after a float (bug 11398).
+
 
 
 * USER INTERFACE
index 5f8e3b21bf2af4dab62099d7a4c92f6dceaf5c8f..6e3bf0fff754a7bf24548074f33fe9f4a67d34b8 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.lastChar() == '\n')
+               if (os.blankLine())
                        str += from_ascii("\\\\\\noindent\n");
                else
                        str += from_ascii("\\\\\\\\\n");
index 2cfcd16da40379e3d9ad40147e56bd232a9fa205..a14f84bf95fec38f64fe101b594c513a6d6532c9 100644 (file)
@@ -82,7 +82,7 @@ public:
        explicit otexstream(odocstream & os)
                : otexrowstream(os), canbreakline_(false),
                  protectspace_(false), terminate_command_(false),
-                 parbreak_(true), lastchar_(0) {}
+                 parbreak_(true), blankline_(true), lastchar_(0) {}
        ///
        void put(char_type const & c);
        ///
@@ -103,6 +103,7 @@ public:
        void lastChar(char_type const & c)
        {
                parbreak_ = (!canbreakline_ && c == '\n');
+               blankline_ = ((!canbreakline_ && c == ' ') || c == '\n');
                canbreakline_ = (c != '\n');
                lastchar_ = c;
        }
@@ -110,6 +111,8 @@ public:
        char_type lastChar() const { return lastchar_; }
        ///
        bool afterParbreak() const { return parbreak_; }
+       ///
+       bool blankLine() const { return blankline_; }
 private:
        ///
        bool canbreakline_;
@@ -120,6 +123,8 @@ private:
        ///
        bool parbreak_;
        ///
+       bool blankline_;
+       ///
        char_type lastchar_;
 };