]> git.lyx.org Git - lyx.git/blobdiff - src/factory.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / factory.C
index c2316ef39edd72228c9814e21b9138c567a8c875..e9a22511a99e5d773a7fe92e32c3ff07c2738fbc 100644 (file)
@@ -54,6 +54,8 @@
 
 #include <cstdio>
 
+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);