X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.C;h=e9a22511a99e5d773a7fe92e32c3ff07c2738fbc;hb=b249c0b0bb43b8c724e82412b22e9ac019bebb87;hp=c2316ef39edd72228c9814e21b9138c567a8c875;hpb=91b3be6f57305be7a2b83d8e1e8774c3e2581752;p=lyx.git diff --git a/src/factory.C b/src/factory.C index c2316ef39e..e9a22511a9 100644 --- a/src/factory.C +++ b/src/factory.C @@ -54,6 +54,8 @@ #include +using namespace lyx::support; + using std::endl; Inset * createInset(FuncRequest const & cmd) @@ -69,7 +71,7 @@ Inset * createInset(FuncRequest const & cmd) return new InsetMinipage(params); case LFUN_INSERT_NOTE: - return new InsetNote(params); + return new InsetNote(params, "Note"); case LFUN_INSET_ERT: return new InsetERT(params); @@ -199,15 +201,17 @@ Inset * createInset(FuncRequest const & cmd) InsetExternal::Params iep; InsetExternalMailer::string2params(cmd.argument, iep); InsetExternal * inset = new InsetExternal; - inset->setFromParams(iep); + string const fpath = cmd.view()->buffer()->filePath(); + inset->setParams(iep, fpath); return inset; } else if (name == "graphics") { + string const fpath = cmd.view()->buffer()->filePath(); InsetGraphicsParams igp; - InsetGraphicsMailer::string2params(cmd.argument, igp); + InsetGraphicsMailer::string2params(cmd.argument, fpath, + igp); InsetGraphics * inset = new InsetGraphics; - string const fpath = cmd.view()->buffer()->filePath(); - inset->setParams(igp, fpath); + inset->setParams(igp); return inset; } else if (name == "include") { @@ -346,8 +350,9 @@ Inset * readInset(LyXLex & lex, Buffer const & buf) inset = new InsetFormula; } else if (tmptok == "Graphics") { inset = new InsetGraphics; - } else if (tmptok == "Note") { - inset = new InsetNote(buf.params); + } else if (tmptok == "Note" || tmptok == "Comment" + || tmptok == "Greyedout") { + inset = new InsetNote(buf.params, tmptok); } else if (tmptok == "Include") { InsetCommandParams p("Include"); inset = new InsetInclude(p, buf);