]> git.lyx.org Git - lyx.git/blobdiff - src/texstream.cpp
Check path of Qt tools if qtchooser is detected
[lyx.git] / src / texstream.cpp
index 16f8dfbe68dee11acfa0a76fbf5e829d2f15ab6e..ec8158d8fd2295d97d906ac7d349e4fb3c11772c 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 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();
 }