X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.cpp;h=ccde5878f9255c7eeb0bda2d6d81280b0103e228;hb=f56ee1875c9bf2665ab7377fdc3ff3ec80d9268f;hp=86f66907b6b1e2f988c95c9dbe56bec90f348fb9;hpb=83d8e12cc1467931c566bca988a070ce992089fc;p=lyx.git diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 86f66907b6..ccde5878f9 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -62,14 +62,14 @@ #include "support/lstrings.h" #include "support/lyxalgo.h" #include "support/TempFile.h" +#include "support/unique_ptr.h" #include "frontends/alert.h" #include "frontends/Clipboard.h" #include "frontends/Selection.h" -#include - #include +#include using namespace std; using namespace lyx::support; @@ -100,11 +100,11 @@ bool checkPastePossible(int index) struct PasteReturnValue { - PasteReturnValue(pit_type r_par, pos_type r_pos, bool r_nu) : - par(r_par), pos(r_pos), needupdate(r_nu) + PasteReturnValue(pit_type r_pit, pos_type r_pos, bool r_nu) : + pit(r_pit), pos(r_pos), needupdate(r_nu) {} - pit_type par; + pit_type pit; pos_type pos; bool needupdate; }; @@ -875,11 +875,9 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut) if (begpit != endpit) cur.screenUpdateFlags(Update::Force | Update::FitCursor); - boost::tie(endpit, endpos) = - eraseSelectionHelper(bp, - text->paragraphs(), - begpit, endpit, - cur.selBegin().pos(), endpos); + tie(endpit, endpos) = + eraseSelectionHelper(bp, text->paragraphs(), begpit, endpit, + cur.selBegin().pos(), endpos); // cutSelection can invalidate the cursor so we need to set // it anew. (Lgb) @@ -1055,7 +1053,8 @@ docstring selection(size_t sel_index, DocumentClassConstPtr docclass) if (sel_index >= theCuts.size()) return docstring(); - boost::scoped_ptr buffer(copyToTempBuffer(theCuts[sel_index].first, docclass)); + unique_ptr buffer(copyToTempBuffer(theCuts[sel_index].first, + docclass)); if (!buffer) return docstring(); @@ -1074,7 +1073,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist, pasteSelectionHelper(cur, parlist, docclass, 0, errorList); cur.forceBufferUpdate(); cur.clearSelection(); - text->setCursor(cur, prv.par, prv.pos); + text->setCursor(cur, prv.pit, prv.pos); } // mathed is handled in InsetMathNest/InsetMathGrid