]> git.lyx.org Git - features.git/commitdiff
use CutAndPaste static methods directly
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 3 Jul 2001 15:39:17 +0000 (15:39 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 3 Jul 2001 15:39:17 +0000 (15:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2176 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormDocument.C
src/insets/ChangeLog
src/insets/insettext.C
src/text2.C

index 4f0f214f780d4849202d79f8c09a2460f616935f..133089743444c85cb7977f1596d6b964c68aa3c9 100644 (file)
@@ -4,6 +4,9 @@
        in NEW_INSETS
        (redoDrawingOfParagraph): ditto
        (redoParagraphs): ditto
+       (cutSelection): don't create a object for CutAndPaste use the
+       static method directly
+       (pasteSelection): ditto
 
        * bufferview_funcs.[Ch]: move ProhibitInput and AllowInput to
        LyXview (+ rename)
index d8a556c6c1a452b7fa73f60955bee34941e6017f..f63debfc0dec447208540617aa775a5a56295896 100644 (file)
@@ -1,5 +1,8 @@
 2001-07-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
+       * FormDocument.C (class_apply): call CutAndPaste::'s staitc method
+       directly. 
+
        * Toolbar_pimpl.h: make owner be a XFormsView, small changes
        because of this.
 
index 75c418227ed797447c905da72047390f2768dd7f..828295fd02d631f34fb67c103f91cba2fd12e521 100644 (file)
@@ -382,8 +382,7 @@ bool FormDocument::class_apply()
                        // successfully loaded
                        redo = true;
                        setMinibuffer(lv_, _("Converting document to new document class..."));
-                       CutAndPaste cap;
-                       int ret = cap.SwitchLayoutsBetweenClasses(
+                       int ret = CutAndPaste::SwitchLayoutsBetweenClasses(
                            params.textclass, new_class,
                            lv_->buffer()->paragraph);
                        if (ret) {
index 61fcbab7e85b29cfecea69ccd9c33d62fef819fc..72bf3900de463a552b865c36cd27c9dcdaa2ea4c 100644 (file)
@@ -1,3 +1,8 @@
+2001-07-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * insettext.C (localDispatch): call CutAndPaste::'s static method
+       directly. 
+
 2001-07-03  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * insetbib.C: no meed to include forms.h here.
index ff1d9119197dcde2581f74a1a91a1dd3f8d9f049..23913b27a4a62baae813e5a6a0312520c288120c 100644 (file)
@@ -993,9 +993,8 @@ InsetText::localDispatch(BufferView * bv,
        }
        case LFUN_PASTE:
                if (!autoBreakRows) {
-                       CutAndPaste cap;
 
-                       if (cap.nrOfParagraphs() > 1) {
+                       if (CutAndPaste::nrOfParagraphs() > 1) {
                                WriteAlert(_("Impossible operation"),
                                                   _("Cannot include more than one paragraph!"),
                                                   _("Sorry."));
index 83c8261a997da4c8336951bd4daa6f57d477a176..749911ab15b9c2df6485c8e483877f003046ee8c 100644 (file)
@@ -1708,22 +1708,20 @@ void LyXText::cutSelection(BufferView * bview, bool doclear)
                selection.start.par()->previous(),
                undoendpar);
     
-       CutAndPaste cap;
-
        // there are two cases: cut only within one paragraph or
        // more than one paragraph
        if (selection.start.par() == selection.end.par()) {
                // only within one paragraph
                endpar = selection.end.par();
                int pos = selection.end.pos();
-               cap.cutSelection(selection.start.par(), &endpar,
+               CutAndPaste::cutSelection(selection.start.par(), &endpar,
                                 selection.start.pos(), pos,
                                 bview->buffer()->params.textclass, doclear);
                selection.end.pos(pos);
        } else {
                endpar = selection.end.par();
                int pos = selection.end.pos();
-               cap.cutSelection(selection.start.par(), &endpar,
+               CutAndPaste::cutSelection(selection.start.par(), &endpar,
                                 selection.start.pos(), pos,
                                 bview->buffer()->params.textclass, doclear);
                cursor.par(endpar);
@@ -1778,9 +1776,7 @@ void LyXText::copySelection(BufferView * bview)
                   || selection.start.pos() < selection.end.pos()))
                selection.start.pos(selection.start.pos() + 1); 
 
-       CutAndPaste cap;
-
-       cap.copySelection(selection.start.par(), selection.end.par(),
+       CutAndPaste::copySelection(selection.start.par(), selection.end.par(),
                          selection.start.pos(), selection.end.pos(),
                          bview->buffer()->params.textclass);
 }
@@ -1788,10 +1784,8 @@ void LyXText::copySelection(BufferView * bview)
 
 void LyXText::pasteSelection(BufferView * bview)
 {
-       CutAndPaste cap;
-
        // this does not make sense, if there is nothing to paste
-       if (!cap.checkPastePossible(cursor.par()))
+       if (!CutAndPaste::checkPastePossible(cursor.par()))
                return;
 
        setUndo(bview->buffer(), Undo::INSERT,
@@ -1802,7 +1796,7 @@ void LyXText::pasteSelection(BufferView * bview)
        Paragraph * actpar = cursor.par();
 
        int pos = cursor.pos();
-       cap.pasteSelection(&actpar, &endpar, pos,
+       CutAndPaste::pasteSelection(&actpar, &endpar, pos,
                           bview->buffer()->params.textclass);
     
        redoParagraphs(bview, cursor, endpar);