]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_mathmlstream.C
oh well
[lyx.git] / src / mathed / math_mathmlstream.C
index 03bc1b2ccb702ef7dbc80472f8eca1c42c42021f..a10691ea1b53412e39fbf64a438445bcf7878110 100644 (file)
@@ -1,13 +1,16 @@
 #include <config.h>
-#include <algorithm>
 
 #include "math_mathmlstream.h"
 #include "math_inset.h"
 #include "math_extern.h"
 #include "debug.h"
+#include "support/lyxalgo.h"
 
 
-MathMLStream::MathMLStream(std::ostream & os)
+using std::ostream;
+
+
+MathMLStream::MathMLStream(ostream & os)
        : os_(os), tab_(0), line_(0), lastchar_(0)
 {}
 
@@ -146,6 +149,13 @@ OctaveStream & operator<<(OctaveStream & ns, char c)
 }
 
 
+OctaveStream & operator<<(OctaveStream & ns, int i)
+{
+       ns.os() << i;
+       return ns;
+}
+
+
 //////////////////////////////////////////////////////////////////////
 
 
@@ -184,16 +194,22 @@ NormalStream & operator<<(NormalStream & ns, char c)
 //////////////////////////////////////////////////////////////////////
 
 
-WriteStream::WriteStream(std::ostream & os, bool fragile)
-       : os_(os), fragile_(fragile), line_(0)
+WriteStream::WriteStream(ostream & os, bool fragile, bool latex)
+       : os_(os), fragile_(fragile), latex_(latex), firstitem_(false), line_(0)
 {}
 
 
-WriteStream::WriteStream(std::ostream & os)
-       : os_(os), fragile_(false), line_(0)
+WriteStream::WriteStream(ostream & os)
+       : os_(os), fragile_(false), latex_(false), firstitem_(false), line_(0)
 {}
 
 
+void WriteStream::addlines(unsigned int n)
+{
+       line_ += n;
+}
+
+
 WriteStream & operator<<(WriteStream & ws, MathInset const * p)
 {
        if (p)
@@ -214,7 +230,7 @@ WriteStream & operator<<(WriteStream & ws, MathArray const & ar)
 WriteStream & operator<<(WriteStream & ws, char const * s)
 {
        ws.os() << s;
-       ws.line() += std::count(s, s + strlen(s), '\n');
+       ws.addlines(int(lyx::count(s, s+strlen(s), '\n')));
        return ws;
 }
 
@@ -223,7 +239,7 @@ WriteStream & operator<<(WriteStream & ws, char c)
 {
        ws.os() << c;
        if (c == '\n')
-               ++ws.line();
+               ws.addlines(1);
        return ws;
 }