]> git.lyx.org Git - lyx.git/blobdiff - src/texstream.h
Fix bug #7404.
[lyx.git] / src / texstream.h
index bf4eb38bba81265c652d5ded86e9dfe0f858d1d8..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_;
 };
 
@@ -183,6 +188,6 @@ template <typename Type>
 otexstream & operator<<(otexstream & ots, Type value);
 
 
-}
+} // namespace lyx
 
 #endif