#include "FuncStatus.h"
#include "Lexer.h"
#include "MetricsInfo.h"
-#include "OutputParams.h"
+#include "output_docbook.h"
#include "output_xhtml.h"
+#include "texstream.h"
#include "frontends/Application.h"
#include "frontends/FontMetrics.h"
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
{
- string command;
switch (kind) {
case InsetNewlineParams::NEWLINE:
os << "newline";
{
string token;
lex.setContext("InsetNewlineParams::read");
- lex >> token;
+ lex >> token;
if (token == "newline")
kind = InsetNewlineParams::NEWLINE;
else if (token == "linebreak")
{
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";
}
-int InsetNewline::docbook(odocstream & os, OutputParams const &) const
+void InsetNewline::docbook(XMLStream &, OutputParams const &) const
{
- os << '\n';
- return 0;
+ // New lines are handled by Paragraph::simpleDocBookOnePar.
}
-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();
}
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);