]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewline.cpp
Fix bug #10904.
[lyx.git] / src / insets / InsetNewline.cpp
index 9e7bd384d1e2ea76821df73ced0ad8a16bbed42f..b10954d4da659210f8192c273c7b47273bd2d87d 100644 (file)
@@ -21,6 +21,7 @@
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "output_xhtml.h"
+#include "texstream.h"
 
 #include "frontends/Application.h"
 #include "frontends/FontMetrics.h"
@@ -40,7 +41,6 @@ InsetNewline::InsetNewline() : Inset(0)
 
 void InsetNewlineParams::write(ostream & os) const
 {
-       string command;
        switch (kind) {
        case InsetNewlineParams::NEWLINE:
                os << "newline";
@@ -56,7 +56,7 @@ void InsetNewlineParams::read(Lexer & lex)
 {
        string token;
        lex.setContext("InsetNewlineParams::read");
-       lex >> token;   
+       lex >> token;
        if (token == "newline")
                kind = InsetNewlineParams::NEWLINE;
        else if (token == "linebreak")
@@ -161,7 +161,8 @@ void InsetNewline::latex(otexstream & os, OutputParams const & rp) const
 }
 
 
-int InsetNewline::plaintext(odocstream & os, OutputParams const &) const
+int InsetNewline::plaintext(odocstringstream & os,
+        OutputParams const &, size_t) const
 {
        os << '\n';
        return PLAINTEXT_NEWLINE;
@@ -177,8 +178,7 @@ int InsetNewline::docbook(odocstream & os, OutputParams const &) const
 
 docstring InsetNewline::xhtml(XHTMLStream & xs, OutputParams const &) const
 {
-       xs << html::CompTag("br");
-       xs.cr();
+       xs << html::CR() << html::CompTag("br") << html::CR();
        return docstring();
 }
 
@@ -245,7 +245,7 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
                yp[0] = int(y - 0.875 * asc * 0.75);
                yp[1] = int(y - 0.500 * asc * 0.75);
                yp[2] = int(y - 0.125 * asc * 0.75);
-       
+
                if (pi.ltr_pos) {
                        xp[0] = int(x + 2 * wid * 0.813);
                        xp[1] = int(x + 2 * wid);
@@ -260,9 +260,9 @@ void InsetNewline::draw(PainterInfo & pi, int x, int y) const
 }
 
 
-docstring InsetNewline::contextMenuName() const
+string InsetNewline::contextMenuName() const
 {
-       return from_ascii("context-newline");
+       return "context-newline";
 }