]> git.lyx.org Git - lyx.git/blobdiff - src/support/docstream.cpp
add debug function which prints the callstack to stderr, disabled by default
[lyx.git] / src / support / docstream.cpp
index 38053606185077a13c4d69241b8d167617c9ac23..f5cf297c12644eb324e58e5e37acb17fb14fdd84 100644 (file)
@@ -412,7 +412,7 @@ void otexstream::put(char_type const & c)
        }
        os_.put(c);
        if (c == '\n') {
-               ++lines_;
+               texrow_.newline();
                canbreakline_ = false;
        } else
                canbreakline_ = true;
@@ -428,7 +428,7 @@ otexstream & operator<<(otexstream & ots, BreakLine)
        if (ots.canBreakLine()) {
                ots.os().put('\n');
                ots.canBreakLine(false);
-               ots.addLines(1);
+               ots.texrow().newline();
        }
        ots.protectSpace(false);
        return ots;
@@ -440,13 +440,22 @@ otexstream & operator<<(otexstream & ots, SafeBreakLine)
        if (ots.canBreakLine()) {
                ots.os() << "%\n";
                ots.canBreakLine(false);
-               ots.addLines(1);
+               ots.texrow().newline();
        }
        ots.protectSpace(false);
        return ots;
 }
 
 
+otexstream & operator<<(otexstream & ots, odocstream_manip pf)
+{
+       ots.os() << pf;
+       if (pf == static_cast<odocstream_manip>(endl))
+               ots.texrow().newline();
+       return ots;
+}
+
+
 otexstream & operator<<(otexstream & ots, docstring const & s)
 {
        size_t const len = s.length();
@@ -461,7 +470,7 @@ otexstream & operator<<(otexstream & ots, docstring const & s)
                ots.protectSpace(false);
        }
        ots.os() << s;
-       ots.addLines(count(s.begin(), s.end(), '\n'));
+       ots.texrow().newlines(count(s.begin(), s.end(), '\n'));
        ots.canBreakLine(s[len - 1] != '\n');
        return ots;
 }
@@ -481,7 +490,7 @@ otexstream & operator<<(otexstream & ots, char const * s)
                ots.protectSpace(false);
        }
        ots.os() << s;
-       ots.addLines(count(s, s + len, '\n'));
+       ots.texrow().newlines(count(s, s + len, '\n'));
        ots.canBreakLine(s[len - 1] != '\n');
        return ots;
 }
@@ -496,7 +505,7 @@ otexstream & operator<<(otexstream & ots, char c)
        }
        ots.os() << c;
        if (c == '\n')
-               ots.addLines(1);
+               ots.texrow().newline();
        ots.canBreakLine(c != '\n');
        return ots;
 }