X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=9fdc37da625b8432861c2ce93b19c0d926762c2d;hb=ac6d3ffb6a5c8b007d198681b169e1d68b0971e9;hp=b8d94336b9f74294f14d61161e360294a9251d23;hpb=d4ca8d74041094f623cc891a30b4dc537137431c;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index b8d94336b9..9fdc37da62 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -65,13 +65,14 @@ #include "frontends/alert.h" #include "support/debug.h" -#include "support/lstrings.h" #include "support/ExceptionMessage.h" - #include "support/lassert.h" +#include "support/lstrings.h" +#include "support/unique_ptr.h" #include + using namespace std; using namespace lyx::support; @@ -309,7 +310,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) case EXTERNAL_CODE: { InsetExternalParams iep; InsetExternal::string2params(to_utf8(cmd.argument()), *buf, iep); - auto_ptr inset(new InsetExternal(buf)); + auto inset = make_unique(buf); inset->setBuffer(*buf); inset->setParams(iep); return inset.release(); @@ -318,7 +319,7 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) case GRAPHICS_CODE: { InsetGraphicsParams igp; InsetGraphics::string2params(to_utf8(cmd.argument()), *buf, igp); - auto_ptr inset(new InsetGraphics(buf)); + auto inset = make_unique(buf); inset->setParams(igp); return inset.release(); } @@ -514,7 +515,7 @@ Inset * readInset(Lexer & lex, Buffer * buf) if (lex.getString() != "\\begin_inset") LYXERR0("Buffer::readInset: Consistency check failed."); - auto_ptr inset; + unique_ptr inset; string tmptok; lex >> tmptok; @@ -590,7 +591,7 @@ Inset * readInset(Lexer & lex, Buffer * buf) return 0; } inset->setBuffer(*buf); - } else { + } else { // FIXME This branch should be made to use inset codes // as the preceding branch does. Unfortunately, that // will take some doing. It requires converting the