]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewline.cpp
Fix bug #12795
[lyx.git] / src / insets / InsetNewline.cpp
index 00b276ea4793f4c94059447b561ead681d3dbe31..ecfacf47cef19f8e8546454980fea97055021f85 100644 (file)
@@ -19,7 +19,6 @@
 #include "FuncStatus.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
-#include "OutputParams.h"
 #include "output_docbook.h"
 #include "output_xhtml.h"
 #include "texstream.h"
@@ -36,10 +35,19 @@ using namespace std;
 
 namespace lyx {
 
-InsetNewline::InsetNewline() : Inset(0)
+InsetNewline::InsetNewline() : Inset(nullptr)
 {}
 
 
+int InsetNewline::rowFlags() const
+{
+       if (params_.kind == InsetNewlineParams::LINEBREAK)
+               return AlwaysBreakAfter;
+       else
+           return AlwaysBreakAfter | Flush;
+}
+
+
 void InsetNewlineParams::write(ostream & os) const
 {
        switch (kind) {
@@ -172,22 +180,9 @@ int InsetNewline::plaintext(odocstringstream & os,
 }
 
 
-void InsetNewline::docbook(XMLStream & xs, OutputParams const & runparams) const
+void InsetNewline::docbook(XMLStream &, OutputParams const &) const
 {
-       if (runparams.docbook_in_par) {
-               xs.closeFontTags();
-
-               // TODO: what if within a list item, and docbookiteminnertag is not para? This would require information
-               // about the paragraph's layout... Good for now, though, this should not happen in DocBook, only maybe
-               // extensions.
-               xs << XMLStream::ESCAPE_NONE << from_utf8("<!-- Is para open? " + string((xs.isTagOpen(xml::StartTag("para"))) ? "yes" : "no") +" -->");
-               xs << XMLStream::ESCAPE_NONE << from_utf8("</para>\n<para");
-               // TODO: that's a hack...
-//             xs << xml::EndTag("para");
-//             xs << xml::CR();
-//             xs << xml::StartTag("para");
-       }
-       // Outside a paragraph, no need to handle new lines.
+       // New lines are handled by Paragraph::simpleDocBookOnePar.
 }