]> git.lyx.org Git - features.git/commitdiff
Provide for the possibility of deferred material, per Andre's excellent
authorRichard Heck <rgheck@comcast.net>
Thu, 31 Dec 2009 15:52:57 +0000 (15:52 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 31 Dec 2009 15:52:57 +0000 (15:52 +0000)
suggestion. Now I wish I'd done XHTMLStream the same way....

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32691 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/MathStream.cpp
src/mathed/MathStream.h

index c0325a97a8b639a3365126ab7c275f6bdf7fdb4e..9ce8f9051ac24e302016130aaac563193810d510 100644 (file)
@@ -305,12 +305,31 @@ void MathStream::cr()
 }
 
 
+void MathStream::defer(docstring const & s)
+{
+       deferred_ << s;
+}
+
+
+void MathStream::defer(string const & s)
+{
+       deferred_ << from_utf8(s);
+}
+
+
+docstring MathStream::deferred() const
+{ 
+       return deferred_.str();
+}
+
+
 MathStream & operator<<(MathStream & ms, docstring const & s)
 {
        ms.os() << s;
        return ms;
 }
 
+
 //////////////////////////////////////////////////////////////////////
 
 
index e93cef123d410480a4caaefe9dfde48b1537532b..51fbdd367e28bdc2e2e808cc9566831218ae979c 100644 (file)
@@ -256,6 +256,12 @@ public:
        int & tab() { return tab_; }
        ///
        friend MathStream & operator<<(MathStream &, char const *);
+       ///
+       void defer(docstring const &);
+       ///
+       void defer(std::string const &);
+       ///
+       docstring deferred() const;
 private:
        ///
        odocstream & os_;
@@ -265,6 +271,8 @@ private:
        int line_;
        ///
        char lastchar_;
+       ///
+       odocstringstream deferred_;
 };
 
 ///