+ switch (cmd.action()) {
+
+ case LFUN_INSET_MODIFY: {
+ InsetNewlineParams params;
+ cur.recordUndo();
+ string2params(to_utf8(cmd.argument()), params);
+ params_.kind = params.kind;
+ break;
+ }
+
+ default:
+ Inset::doDispatch(cur, cmd);
+ break;
+ }
+}
+
+
+bool InsetNewline::getStatus(Cursor & cur, FuncRequest const & cmd,
+ FuncStatus & status) const
+{
+ switch (cmd.action()) {
+ // we handle these
+ case LFUN_INSET_MODIFY:
+ if (cmd.getArg(0) == "newline") {
+ InsetNewlineParams params;
+ string2params(to_utf8(cmd.argument()), params);
+ status.setOnOff(params_.kind == params.kind);
+ }
+ status.setEnabled(true);
+ return true;
+ default:
+ return Inset::getStatus(cur, cmd, status);
+ }
+}
+
+
+ColorCode InsetNewline::ColorName() const
+{
+ switch (params_.kind) {
+ case InsetNewlineParams::NEWLINE:
+ return Color_eolmarker;
+ break;
+ case InsetNewlineParams::LINEBREAK:
+ return Color_pagebreak;
+ break;
+ }
+ // not really useful, but to avoids gcc complaints
+ return Color_eolmarker;
+}
+
+
+void InsetNewline::latex(otexstream & os, OutputParams const & rp) const
+{
+ switch (params_.kind) {
+ case InsetNewlineParams::NEWLINE:
+ if (rp.inTableCell == OutputParams::PLAIN)
+ os << "\\newline\n";
+ else
+ os << "\\\\\n";
+ break;
+ case InsetNewlineParams::LINEBREAK:
+ os << "\\linebreak{}\n";
+ break;
+ default:
+ os << "\\\\\n";
+ break;
+ }