]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.C
remove unused code
[lyx.git] / src / CutAndPaste.C
index 5b0430492734954d02ee91e3820f4502225bb160..6117a5048180036740506d672dd8fff3c87377dc 100644 (file)
@@ -24,7 +24,7 @@
 #include "gettext.h"
 #include "iterators.h"
 #include "lyxtextclasslist.h"
-
+#include "undo_funcs.h"
 #include "insets/inseterror.h"
 
 using std::pair;
@@ -144,7 +144,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
                if (doclear)
                        startpar->next()->stripLeadingSpaces();
                if (startpar->hasSameLayout(startpar->next()) ||
-                   !startpar->next()->size()) {
+                   startpar->next()->empty()) {
                        startpar->pasteParagraph(current_view->buffer()->params);
                        (*endpar) = startpar; // this because endpar gets deleted here!
                }
@@ -367,10 +367,10 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
                if (lastbuffer->next() && paste_the_end) {
                        if (lastbuffer->next()->hasSameLayout(lastbuffer)) {
                                lastbuffer->pasteParagraph(current_view->buffer()->params);
-                       } else if (!lastbuffer->next()->size()) {
+                       } else if (lastbuffer->next()->empty()) {
                                lastbuffer->next()->makeSameLayout(lastbuffer);
                                lastbuffer->pasteParagraph(current_view->buffer()->params);
-                       } else if (!lastbuffer->size()) {
+                       } else if (lastbuffer->empty()) {
                                lastbuffer->makeSameLayout(lastbuffer->next());
                                lastbuffer->pasteParagraph(current_view->buffer()->params);
                        } else
@@ -427,6 +427,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
                                + _("\nbecause of class conversion from\n")
                                + tclass1.name() + _(" to ")
                                + tclass2.name();
+                       freezeUndo();
                        InsetError * new_inset = new InsetError(s);
                        LyXText * txt = current_view->getLyXText();
                        LyXCursor cur = txt->cursor;
@@ -434,6 +435,7 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(textclass_type c1,
                        txt->insertInset(current_view, new_inset);
                        txt->fullRebreak(current_view);
                        txt->setCursorIntern(current_view, cur.par(), cur.pos());
+                       unFreezeUndo();
                }
        }
        return ret;