X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffactory.cpp;h=a03f88fa2838900d71da17959df81bcd4d2afc1d;hb=8da87f9dbf65f99f371ef9c3834e846c3fbe1c81;hp=bf25fbd43ea5d158a053513d4cacbadd8150066c;hpb=62d36bf04d436c83ddace8aeaf4dbd493d674cdf;p=lyx.git diff --git a/src/factory.cpp b/src/factory.cpp index bf25fbd43e..a03f88fa28 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; @@ -107,6 +108,8 @@ Inset * createInsetHelper(Buffer * buf, FuncRequest const & cmd) inp.kind = InsetSeparatorParams::PLAIN; else if (name == "parbreak") inp.kind = InsetSeparatorParams::PARBREAK; + else if (name == "latexpar") + inp.kind = InsetSeparatorParams::LATEXPAR; else { lyxerr << "Wrong argument for LyX function 'separator-insert'." << endl; break; @@ -307,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(); @@ -316,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(); } @@ -512,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; @@ -538,7 +541,7 @@ Inset * readInset(Lexer & lex, Buffer * buf) //Worst case, we could put it in each case below. Better, we could //pass the lexer to the constructor and let the params be built there. InsetCommandParams inscmd(code); - inscmd.read(lex, buf); + inscmd.Read(lex, buf); switch (code) { case BIBITEM_CODE: