]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathStream.cpp
Allow automatic text direction in Painter::text()
[lyx.git] / src / mathed / MathStream.cpp
index ed23eb416040a88a6303bb721d965d33cb5b68f9..dabfc0680f93bb5ff8a03a9b9d880290be681aeb 100644 (file)
@@ -121,8 +121,8 @@ WriteStream & operator<<(WriteStream & ws, docstring const & s)
 }
 
 
-WriteStream::WriteStream(odocstream & os, bool fragile, bool latex, OutputType output,
-                       Encoding const * encoding)
+WriteStream::WriteStream(otexrowstream & os, bool fragile, bool latex,
+                                                OutputType output, Encoding const * encoding)
        : os_(os), fragile_(fragile), firstitem_(false), latex_(latex),
          output_(output), pendingspace_(false), pendingbrace_(false),
          textmode_(false), locked_(0), ascii_(0), canbreakline_(true),
@@ -130,11 +130,11 @@ WriteStream::WriteStream(odocstream & os, bool fragile, bool latex, OutputType o
 {}
 
 
-WriteStream::WriteStream(odocstream & os)
+WriteStream::WriteStream(otexrowstream & os)
        : os_(os), fragile_(false), firstitem_(false), latex_(false),
          output_(wsDefault), pendingspace_(false), pendingbrace_(false),
          textmode_(false), locked_(0), ascii_(0), canbreakline_(true),
-         line_(0), encoding_(0)
+         line_(0), encoding_(0) 
 {}
 
 
@@ -183,6 +183,29 @@ void WriteStream::asciiOnly(bool ascii)
 }
 
 
+void WriteStream::pushRowEntry(TexRow::RowEntry entry)
+{
+       outer_row_entries_.push_back(entry);
+}
+
+
+void WriteStream::popRowEntry()
+{
+       if (!outer_row_entries_.empty())
+               outer_row_entries_.pop_back();
+}
+
+
+bool WriteStream::startOuterRow()
+{
+       size_t n = outer_row_entries_.size();
+       if (n > 0)
+               return texrow().start(outer_row_entries_[n - 1]);
+       else
+               return false;
+}
+
+
 WriteStream & operator<<(WriteStream & ws, MathAtom const & at)
 {
        at->write(ws);