case LFUN_INSET_MODIFY: {
cur.recordUndo();
- InsetVSpace::string2params(to_utf8(cmd.argument()), space_);
+ string arg = to_utf8(cmd.argument());
+ if (arg == "vspace custom")
+ arg = (space_.kind() == VSpace::LENGTH)
+ ? "vspace " + space_.length().asString()
+ : "vspace 1" + string(stringFromUnit(Length::defaultUnit()));
+ InsetVSpace::string2params(arg, space_);
break;
}
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "vspace") {
VSpace vspace;
- InsetVSpace::string2params(to_utf8(cmd.argument()), vspace);
+ string arg = to_utf8(cmd.argument());
+ if (arg == "vspace custom")
+ arg = (space_.kind() == VSpace::LENGTH)
+ ? "vspace " + space_.length().asString()
+ : "vspace 1" + string(stringFromUnit(Length::defaultUnit()));
+ InsetVSpace::string2params(arg, vspace);
status.setOnOff(vspace == space_);
}
status.setEnabled(true);
void InsetVSpace::read(Lexer & lex)
{
- LASSERT(lex.isOK(), /**/);
+ LASSERT(lex.isOK(), return);
string vsp;
lex >> vsp;
if (lex)
}
-int InsetVSpace::latex(odocstream & os, OutputParams const &) const
+void InsetVSpace::latex(otexstream & os, OutputParams const &) const
{
os << from_ascii(space_.asLatexCommand(buffer().params())) << '\n';
- return 1;
}
-int InsetVSpace::plaintext(odocstream & os, OutputParams const &) const
+int InsetVSpace::plaintext(odocstringstream & os,
+ OutputParams const &, size_t) const
{
os << "\n\n";
return PLAINTEXT_NEWLINE;
}
-docstring InsetVSpace::contextMenu(BufferView const &, int, int) const
+string InsetVSpace::contextMenuName() const
{
- return from_ascii("context-vspace");
+ return "context-vspace";
}