X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FCutAndPaste.C;h=058ee2d6a4ba562d142a7fce29e1b3b6a7bab096;hb=cb52251ccff29d6cbfa13ab90a96be566e3f41ac;hp=a3c6f64d879a9c235279d93a4ccdaa2dfaed15d5;hpb=0756c7aed167314658fd77c993f223f4054f65bd;p=lyx.git diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index a3c6f64d87..058ee2d6a4 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -23,6 +23,7 @@ #endif using std::pair; +using lyx::pos_type; extern BufferView * current_view; @@ -88,7 +89,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar, // only within one paragraph if (realcut) buf = new Paragraph; - Paragraph::size_type i = start; + pos_type i = start; if (end > startpar->size()) end = startpar->size(); for (; i < end; ++i) { @@ -151,11 +152,10 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar, textclass = tc; - if (!endpar || - startpar == endpar) { + if (!endpar || startpar == endpar) { // only within one paragraph buf = new Paragraph; - Paragraph::size_type i = start; + pos_type i = start; if (end > startpar->size()) end = startpar->size(); for (; i < end; ++i) { @@ -166,20 +166,20 @@ bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar, // copy more than one paragraph // clone the paragraphs within the selection Paragraph * tmppar = startpar; - buf = new Paragraph(*tmppar); + buf = new Paragraph(*tmppar, false); Paragraph * tmppar2 = buf; while (tmppar != endpar && tmppar->next()) { tmppar = tmppar->next(); - tmppar2->next(new Paragraph(*tmppar)); + tmppar2->next(new Paragraph(*tmppar, false)); tmppar2->next()->previous(tmppar2); tmppar2 = tmppar2->next(); } tmppar2->next(0); // the buf paragraph is too big - Paragraph::size_type tmpi2 = start; + pos_type tmpi2 = start; for (; tmpi2; --tmpi2) buf->erase(0); @@ -209,7 +209,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // There are two cases: cutbuffer only one paragraph or many if (!buf->next()) { // only within a paragraph - Paragraph * tmpbuf = new Paragraph(*buf); + Paragraph * tmpbuf = new Paragraph(*buf, false); // Some provisions should be done here for checking // if we are inserting at the beginning of a @@ -239,12 +239,12 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar, // make a copy of the simple cut_buffer Paragraph * tmpbuf = buf; - Paragraph * simple_cut_clone = new Paragraph(*tmpbuf); + Paragraph * simple_cut_clone = new Paragraph(*tmpbuf, false); Paragraph * tmpbuf2 = simple_cut_clone; while (tmpbuf->next()) { tmpbuf = tmpbuf->next(); - tmpbuf2->next(new Paragraph(*tmpbuf)); + tmpbuf2->next(new Paragraph(*tmpbuf, false)); tmpbuf2->next()->previous(tmpbuf2); tmpbuf2 = tmpbuf2->next(); }