]> git.lyx.org Git - features.git/blobdiff - src/texstream.cpp
Rationalise includes
[features.git] / src / texstream.cpp
index 16f8dfbe68dee11acfa0a76fbf5e829d2f15ab6e..f748f8a4d27687c232b9e9ff4b8bcaf2767112f9 100644 (file)
@@ -11,6 +11,9 @@
 #include <config.h>
 
 #include "texstream.h"
+
+#include "TexRow.h"
+
 #include "support/lstrings.h"
 #include "support/unicode.h"
 
@@ -30,10 +33,26 @@ using lyx::support::split;
 namespace lyx {
 
 
-void otexrowstream::append(docstring const & str, TexRow const & texrow)
+otexrowstream::otexrowstream(odocstream & os, bool enable)
+       : os_(os), texrow_(make_unique<TexRow>(enable))
+{}
+
+
+otexrowstream::~otexrowstream() = default;
+
+
+unique_ptr<TexRow> && otexrowstream::releaseTexRow()
+{
+       auto p = make_unique<TexRow>();
+       swap(texrow_, p);
+       return move(p);
+}
+
+
+void otexrowstream::append(docstring const & str, TexRow texrow)
 {
        os_ << str;
-       texrow_.append(texrow);
+       texrow_->append(move(texrow));
 }
 
 
@@ -41,7 +60,7 @@ void otexrowstream::put(char_type const & c)
 {
        os_.put(c);
        if (c == '\n')
-               texrow_.newline();
+               texrow_->newline();
 }