]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewline.cpp
New DocBook support
[lyx.git] / src / insets / InsetNewline.cpp
index 411da120eb60120df773d8f9771209d2d57d0c1e..86f60f6b3a5441d6be3764daf25075d1f1637d5f 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <config.h>
+#include <output_docbook.h>
 
 #include "InsetNewline.h"
 
@@ -56,7 +57,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")
@@ -146,7 +147,9 @@ void InsetNewline::latex(otexstream & os, OutputParams const & rp) const
 {
        switch (params_.kind) {
                case InsetNewlineParams::NEWLINE:
-                       if (rp.inTableCell == OutputParams::PLAIN)
+                       if (!rp.newlinecmd.empty())
+                               os << "\\" << rp.newlinecmd << "\n";
+                       else if (rp.inTableCell == OutputParams::PLAIN)
                                os << "\\newline\n";
                        else
                                os << "\\\\\n";
@@ -169,16 +172,19 @@ int InsetNewline::plaintext(odocstringstream & os,
 }
 
 
-int InsetNewline::docbook(odocstream & os, OutputParams const &) const
+void InsetNewline::docbook(XMLStream & xs, OutputParams const & runparams) const
 {
-       os << '\n';
-       return 0;
+       if (runparams.docbook_in_par) {
+               xs.closeFontTags();
+               xs << xml::EndTag("para");
+               xs << xml::StartTag("para");
+       }
 }
 
 
-docstring InsetNewline::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetNewline::xhtml(XMLStream & xs, OutputParams const &) const
 {
-       xs << html::CR() << html::CompTag("br") << html::CR();
+       xs << xml::CR() << xml::CompTag("br") << xml::CR();
        return docstring();
 }
 
@@ -245,7 +251,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);