]> git.lyx.org Git - lyx.git/blobdiff - src/factory.cpp
SCons: msvc does not need this /TP option any more after we rename .C => .cpp. Also...
[lyx.git] / src / factory.cpp
index a0f0ee35379a99d7c06bc3d38adc407537100463..c790a377037479a1c6cc2a138a036d0158318351 100644 (file)
@@ -21,7 +21,6 @@
 #include "Color.h"
 #include "Lexer.h"
 #include "LyX.h"
-#include "Paragraph.h"
 
 #include "insets/InsetBibitem.h"
 #include "insets/InsetBibtex.h"
 
 #include <sstream>
 
+using std::auto_ptr;
+using std::endl;
+using std::string;
+
 
 namespace lyx {
 
@@ -76,14 +79,10 @@ namespace Alert = frontend::Alert;
 
 using support::compare_ascii_no_case;
 
-using std::auto_ptr;
-using std::endl;
-using std::string;
-
 
 Inset * createInset(BufferView * bv, FuncRequest const & cmd)
 {
-       BufferParams const & params = bv->buffer()->params();
+       BufferParams const & params = bv->buffer().params();
 
        try {
 
@@ -208,7 +207,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                                r = 2;
                        if (c <= 0)
                                c = 2;
-                       return new InsetTabular(*bv->buffer(), r, c);
+                       return new InsetTabular(bv->buffer(), r, c);
                }
 
                case LFUN_CAPTION_INSERT: {
@@ -229,7 +228,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                        return new InsetTOC(InsetCommandParams("tableofcontents"));
 
                case LFUN_ENVIRONMENT_INSERT:
-                       return new InsetEnvironment(params, to_utf8(cmd.argument()));
+                       return new InsetEnvironment(params, cmd.argument());
 
 #if 0
                case LFUN_LIST_INSERT:
@@ -271,7 +270,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                                return new InsetListings(params, par);
 
                        } else if (name == "external") {
-                               Buffer const & buffer = *bv->buffer();
+                               Buffer const & buffer = bv->buffer();
                                InsetExternalParams iep;
                                InsetExternalMailer::string2params(to_utf8(cmd.argument()),
                                        buffer, iep);
@@ -280,7 +279,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                                return inset.release();
 
                        } else if (name == "graphics") {
-                               Buffer const & buffer = *bv->buffer();
+                               Buffer const & buffer = bv->buffer();
                                InsetGraphicsParams igp;
                                InsetGraphicsMailer::string2params(to_utf8(cmd.argument()),
                                        buffer, igp);
@@ -315,7 +314,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                                InsetCommandParams icp(name);
                                InsetCommandMailer::string2params(name, to_utf8(cmd.argument()),
                                        icp);
-                               return new InsetRef(icp, *bv->buffer());
+                               return new InsetRef(icp, bv->buffer());
 
                        } else if (name == "toc") {
                                InsetCommandParams icp("tableofcontents");
@@ -492,7 +491,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                        inset.reset(new InsetInclude(p));
                } else if (tmptok == "Environment") {
                        lex.next();
-                       inset.reset(new InsetEnvironment(buf.params(), lex.getString()));
+                       inset.reset(new InsetEnvironment(buf.params(), lex.getDocString()));
                } else if (tmptok == "ERT") {
                        inset.reset(new InsetERT(buf.params()));
                } else if (tmptok == "listings") {
@@ -539,9 +538,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
 
                inset->read(buf, lex);
 
-#ifdef WITH_WARNINGS
-#warning hack..
-#endif
+// FIXME: hack..
                if (inset->lyxCode() == Inset::MATHMACRO_CODE) {
                        MathMacroTemplate const * tmpl =
                                static_cast<MathMacroTemplate*>(inset.get());