X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=bdae9a01f9f660d5e555f89e2e980157f4a5f645;hb=176123afcf4484f1a0859dee515690cfd45bc1b6;hp=d763e52f5becb22227881dd8c4b3e52e61f41672;hpb=dea050cb93ec5b427caaf1dcfe0e0addec121881;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index d763e52f5b..bdae9a01f9 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -145,11 +145,28 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) case LFUN_ARGUMENT_INSERT: return new InsetArgument(buf); - case LFUN_FLOAT_INSERT: - return new InsetFloat(buf, to_utf8(cmd.argument())); + case LFUN_FLOAT_INSERT: { + string argument = to_utf8(cmd.argument()); + if (!argument.empty()) { + if (!contains(argument, "sideways")) { + if (!contains(argument, "wide")) + argument += "\nwide false"; + argument += "\nsideways false"; + } + } + return new InsetFloat(buf, argument); + } case LFUN_FLOAT_WIDE_INSERT: { - InsetFloat * fl = new InsetFloat(buf, to_utf8(cmd.argument())); + string argument = to_utf8(cmd.argument()); + if (!argument.empty()) { + if (!contains(argument, "sideways")) { + if (!contains(argument, "wide")) + argument += "\nwide true"; + argument += "\nsideways false"; + } + } + InsetFloat * fl = new InsetFloat(buf, argument); fl->setWide(true); return fl; } @@ -210,6 +227,12 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) case LFUN_PREVIEW_INSERT: return new InsetPreview(buf); + case LFUN_SCRIPT_INSERT: { + InsetScriptParams isp; + InsetScript::string2params("script script " + to_utf8(cmd.argument()), isp); + return new InsetScript(buf, isp); + } + case LFUN_INSET_INSERT: { string const name = cmd.getArg(0); InsetCode code = insetCode(name);