]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathStream.h
Fix regression of 5261ae6a2
[lyx.git] / src / mathed / MathStream.h
index 70fdf30ef63454ad57be4578969d5563d0ba24ce..ad1baada353dcd214b682442db7def4527a3a0d2 100644 (file)
@@ -59,6 +59,10 @@ public:
        bool & firstitem() { return firstitem_; }
        ///
        void addlines(unsigned int);
+       /// record whether we can write an immediately following newline char
+       void canBreakLine(bool breakline) { canbreakline_ = breakline; }
+       /// tell whether we can write an immediately following newline char
+       bool canBreakLine() const { return canbreakline_; }
        /// writes space if next thing is isalpha()
        void pendingSpace(bool how);
        /// writes space if next thing is isalpha()
@@ -102,6 +106,8 @@ private:
        bool locked_;
        /// should we use only ascii chars when producing latex code?
        bool ascii_;
+       /// are we allowed to output an immediately following newline?
+       bool canbreakline_;
        ///
        int line_;
        ///
@@ -293,9 +299,7 @@ public:
        bool inText() const { return in_text_; }
 private:
        ///
-       void setTextMode() { in_text_ = true; }
-       ///
-       void setMathMode() { in_text_ = false; }
+       void setTextMode(bool t) { in_text_ = t; }
        ///
        odocstream & os_;
        ///
@@ -303,8 +307,6 @@ private:
        ///
        int line_;
        ///
-       char lastchar_;
-       ///
        bool in_text_;
        ///
        odocstringstream deferred_;
@@ -331,30 +333,16 @@ MathStream & operator<<(MathStream &, ETag const &);
 
 
 /// A simpler version of ModeSpecifier, for MathML
-// FIXME There are still problems here with nesting, at least
-// potentially. The problem is that true nesting of text mode isn't
-// actually possible. I.e., we can't have: 
-//             <mtext><mtext></mtext></mtext>
-// So we have to have:
-//             <mtext></mtext><mtext></mtext><mtext></mtext>
-// instead, where the last is really a continuation of the first.
-// We'll need some kind of stack to remember all that.
 class SetMode {
 public:
-       ///
-       explicit SetMode(MathStream & os, bool text, std::string const & attrs);
        ///
        explicit SetMode(MathStream & os, bool text);
        ///
        ~SetMode();
 private:
-       ///
-       void init(bool, std::string const &);
        ///
        MathStream & os_;
        ///
-       bool opened_;
-       ///
        bool was_text_;
 };
 
@@ -383,9 +371,7 @@ public:
        bool inText() const { return in_text_; }
 private:
        ///
-       void setTextMode() { in_text_ = true; }
-       ///
-       void setMathMode() { in_text_ = false; }
+       void setTextMode(bool t) { in_text_ = t; }
        ///
        odocstream & os_;
        ///
@@ -393,8 +379,6 @@ private:
        ///
        int line_;
        ///
-       char lastchar_;
-       ///
        bool in_text_;
        ///
        odocstringstream deferred_;
@@ -422,20 +406,14 @@ HtmlStream & operator<<(HtmlStream &, ETag const &);
 
 class SetHTMLMode {
 public:
-       ///
-       explicit SetHTMLMode(HtmlStream & os, bool text, std::string attrs);
        ///
        explicit SetHTMLMode(HtmlStream & os, bool text);
        ///
        ~SetHTMLMode();
 private:
-       ///
-       void init(bool, std::string const &);
        ///
        HtmlStream & os_;
        ///
-       bool opened_;
-       ///
        bool was_text_;
 };