]> git.lyx.org Git - features.git/blobdiff - src/CutAndPaste.C
remove LyXParagraph Clone use newly added copy constructor instead, some whitespace...
[features.git] / src / CutAndPaste.C
index 1ac379811b908fb3ff874e84bc2718a897b00ac7..b549d2013c59c6fd11bdb86e15ad346649c431b0 100644 (file)
@@ -159,13 +159,21 @@ bool CutAndPaste::copySelection(LyXParagraph * startpar, LyXParagraph * endpar,
                // copy more than one paragraph
                // clone the paragraphs within the selection
                LyXParagraph * tmppar = startpar;
+#if 0
                buf = tmppar->Clone();
+#else
+               buf = new LyXParagraph(*tmppar);
+#endif
                LyXParagraph * tmppar2 = buf;
                
                while (tmppar != endpar
                       && tmppar->next()) {
                        tmppar = tmppar->next();
+#if 0
                        tmppar2->next(tmppar->Clone());
+#else
+                       tmppar2->next(new LyXParagraph(*tmppar));
+#endif
                        tmppar2->next()->previous(tmppar2);
                        tmppar2 = tmppar2->next();
                }
@@ -195,14 +203,18 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
        if (pos > (*par)->size())
                pos = (*par)->size();
        
-       LyXParagraph * tmpbuf;
+       // LyXParagraph * tmpbuf;
        LyXParagraph * tmppar = *par;
        int tmppos = pos;
        
        // There are two cases: cutbuffer only one paragraph or many
        if (!buf->next()) {
                // only within a paragraph
-               tmpbuf = buf->Clone();
+#if 0
+               LyXParagraph * tmpbuf = buf->Clone();
+#else
+               LyXParagraph * tmpbuf = new LyXParagraph(*buf);
+#endif
                // Some provisions should be done here for checking
                // if we are inserting at the beginning of a
                // paragraph. If there are a space at the beginning
@@ -230,12 +242,20 @@ bool CutAndPaste::pasteSelection(LyXParagraph ** par, LyXParagraph ** endpar,
                // many paragraphs
                
                // make a copy of the simple cut_buffer
-               tmpbuf = buf;
+               LyXParagraph * tmpbuf = buf;
+#if 0
                LyXParagraph * simple_cut_clone = tmpbuf->Clone();
+#else
+               LyXParagraph * simple_cut_clone = new LyXParagraph(*tmpbuf);
+#endif
                LyXParagraph * tmpbuf2 = simple_cut_clone;
                while (tmpbuf->next()) {
                        tmpbuf = tmpbuf->next();
+#if 0
                        tmpbuf2->next(tmpbuf->Clone());
+#else
+                       tmpbuf2->next(new LyXParagraph(*tmpbuf));
+#endif
                        tmpbuf2->next()->previous(tmpbuf2);
                        tmpbuf2 = tmpbuf2->next();
                }