* Licence details can be found in the file COPYING.
*
* \author John Levon
- * \author Jürgen Spitzmüller
+ * \author Jürgen Spitzmüller
*
* Full author contact details are available in file CREDITS.
*/
#include "Lexer.h"
#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "output_xhtml.h"
#include "frontends/Application.h"
#include "frontends/FontMetrics.h"
namespace lyx {
-InsetNewline::InsetNewline()
+InsetNewline::InsetNewline() : Inset(0)
{}
kind = InsetNewlineParams::LINEBREAK;
else
lex.printError("Unknown kind: `$$Token'");
- lex >> "\\end_inset";
}
void InsetNewline::read(Lexer & lex)
{
params_.read(lex);
+ lex >> "\\end_inset";
}
case InsetNewlineParams::LINEBREAK:
return Color_pagebreak;
break;
- default:
- return Color_eolmarker;
- break;
}
+ // not really useful, but to avoids gcc complaints
+ return Color_eolmarker;
}
-int InsetNewline::latex(odocstream & os, OutputParams const &) const
+int InsetNewline::latex(odocstream & os, OutputParams const & rp) const
{
switch (params_.kind) {
case InsetNewlineParams::NEWLINE:
- os << "\\\\\n";
+ if (rp.inTableCell == OutputParams::PLAIN)
+ os << "\\newline\n";
+ else
+ os << "\\\\\n";
break;
case InsetNewlineParams::LINEBREAK:
os << "\\linebreak{}\n";
}
+docstring InsetNewline::xhtml(XHTMLStream & xs, OutputParams const &) const
+{
+ xs << CompTag("br");
+ xs.cr();
+ return docstring();
+}
+
+
void InsetNewline::draw(PainterInfo & pi, int x, int y) const
{
FontInfo font;