]> git.lyx.org Git - lyx.git/blobdiff - src/factory.C
ws changes only
[lyx.git] / src / factory.C
index 4eabc25c46bce2c5260f3b9d53bae1954f777b94..6c728827d22d15f5a48cbb4e86bab3b36165ec48 100644 (file)
@@ -39,6 +39,7 @@
 #include "insets/insetmarginal.h"
 #include "insets/insetminipage.h"
 #include "insets/insetnote.h"
+#include "insets/insetbox.h"
 #include "insets/insetbranch.h"
 #include "insets/insetoptarg.h"
 #include "insets/insetref.h"
 #include "support/lstrings.h"
 #include "support/std_sstream.h"
 
+#include <boost/assert.hpp>
+
 using lyx::support::compare_ascii_no_case;
 
 using std::endl;
+using std::string;
 
 
 InsetOld * createInset(FuncRequest const & cmd)
@@ -79,6 +83,13 @@ InsetOld * createInset(FuncRequest const & cmd)
                                arg = "Note";
                        return new InsetNote(params, arg);
                }
+       case LFUN_INSERT_BOX:
+               {
+                       string arg = cmd.getArg(0);
+                       if (arg.empty())
+                               arg = "Boxed";
+                       return new InsetBox(params, arg);
+               }
        case LFUN_INSERT_BRANCH:
                {
                        string arg = cmd.getArg(0);
@@ -214,7 +225,7 @@ InsetOld * createInset(FuncRequest const & cmd)
 
                } else if (name == "external") {
                        Buffer const & buffer = *cmd.view()->buffer();
-                       InsetExternal::Params iep;
+                       InsetExternalParams iep;
                        InsetExternalMailer::string2params(cmd.argument,
                                                           buffer, iep);
                        InsetExternal * inset = new InsetExternal;
@@ -354,6 +365,9 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf)
                        inset = new InsetFloatList("table");
                } else if (cmdName == "printindex") {
                        inset = new InsetPrintIndex(inscmd);
+               } else {
+                       lyxerr << "unknown CommandInset '" << cmdName << "'" << std::endl;
+                       BOOST_ASSERT(false);
                }
        } else {
                if (tmptok == "Quotes") {
@@ -369,6 +383,10 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf)
                } else if (tmptok == "Note"     || tmptok == "Comment"
                                || tmptok == "Greyedout") {
                        inset = new InsetNote(buf.params(), tmptok);
+               } else if (tmptok == "Boxed" || tmptok == "ovalbox"
+                       || tmptok == "Shadowbox" || tmptok == "Doublebox"
+                       || tmptok == "Ovalbox" || tmptok == "Frameless") {
+                       inset = new InsetBox(buf.params(), tmptok);
                } else if (tmptok == "Branch") {
                        inset = new InsetBranch(buf.params(), string());
                } else if (tmptok == "Include") {
@@ -411,10 +429,12 @@ InsetOld * readInset(LyXLex & lex, Buffer const & buf)
                        inset = new InsetCaption(buf.params());
                } else if (tmptok == "FloatList") {
                        inset = new InsetFloatList;
+               } else {
+                       lyxerr << "unknown Inset type '" << tmptok << "'" << std::endl;
+                       BOOST_ASSERT(false);
                }
 
-               if (inset)
-                       inset->read(buf, lex);
+               inset->read(buf, lex);
        }
 
        return inset;