X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText.cpp;h=12ab04f043397925fbfdd47059172509702d7149;hb=1440b6a2fc6d39782a486f045d72506eb9215712;hp=c003350781a0d87290ab615b1c576434e0565128;hpb=f78967a802a4362992b0af7e3cb361719da53ff2;p=lyx.git diff --git a/src/Text.cpp b/src/Text.cpp index c003350781..12ab04f043 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -69,6 +69,7 @@ #include "support/lyxalgo.h" #include "support/lyxtime.h" #include "support/textutils.h" +#include "support/unique_ptr.h" #include @@ -187,9 +188,8 @@ Text::Text(InsetText * owner, bool use_default_layout) Text::Text(InsetText * owner, Text const & text) - : owner_(owner) + : owner_(owner), pars_(text.pars_) { - pars_ = text.pars_; ParagraphList::iterator const end = pars_.end(); ParagraphList::iterator it = pars_.begin(); for (; it != end; ++it) @@ -464,8 +464,7 @@ void Text::readParToken(Paragraph & par, Lexer & lex, } else if (token == "\\SpecialChar" || (token == "\\SpecialCharNoPassThru" && !par.layout().pass_thru && !inset().isPassThru())) { - auto_ptr inset; - inset.reset(new InsetSpecialChar); + auto inset = make_unique(); inset->read(lex); inset->setBuffer(*buf); par.insertInset(par.size(), inset.release(), font, change); @@ -474,8 +473,7 @@ void Text::readParToken(Paragraph & par, Lexer & lex, docstring const s = ltrim(lex.getDocString(), "\\"); par.insert(par.size(), s, font, change); } else if (token == "\\IPAChar") { - auto_ptr inset; - inset.reset(new InsetIPAChar); + auto inset = make_unique(); inset->read(lex); inset->setBuffer(*buf); par.insertInset(par.size(), inset.release(), font, change); @@ -500,7 +498,7 @@ void Text::readParToken(Paragraph & par, Lexer & lex, } else if (token == "\\backslash") { par.appendChar('\\', font, change); } else if (token == "\\LyXTable") { - auto_ptr inset(new InsetTabular(buf)); + auto inset = make_unique(buf); inset->read(lex); par.insertInset(par.size(), inset.release(), font, change); } else if (token == "\\change_unchanged") {