X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetNewline.cpp;h=ecfacf47cef19f8e8546454980fea97055021f85;hb=8124e6c02ea1fd6779bb6c47ffe2bca2c8bd2d97;hp=45d52b23da249920379cd4c6d92b5e64f2cf3dbf;hpb=9b7db1190120de5031efd785b4607bd900418cbb;p=lyx.git diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp index 45d52b23da..ecfacf47ce 100644 --- a/src/insets/InsetNewline.cpp +++ b/src/insets/InsetNewline.cpp @@ -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,21 +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(); - if (!xs.pending_tags_empty()) { - xs << xml::EndTag("para"); - xs << xml::StartTag("para"); - } - else { - xs << xml::CR() << xml::CompTag("br") << xml::CR(); - } - } - else { - xs << xml::CR() << xml::CompTag("br") << xml::CR(); - } + // New lines are handled by Paragraph::simpleDocBookOnePar. }