]> git.lyx.org Git - lyx.git/blobdiff - src/Text2.cpp
* Paragraph: reserve memory by chunks of 100 chars. This improve the loading of big...
[lyx.git] / src / Text2.cpp
index bd7effb23f36ced85b42935a167e2c8170271782..86115d546752184579770e050be501de355ba93f 100644 (file)
@@ -28,6 +28,7 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Bullet.h"
+#include "Changes.h"
 #include "Color.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
@@ -48,7 +49,6 @@
 #include "Server.h"
 #include "ServerSocket.h"
 #include "TextMetrics.h"
-#include "Undo.h"
 #include "VSpace.h"
 
 #include "frontends/FontMetrics.h"
@@ -292,7 +292,7 @@ void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
        BOOST_ASSERT(this == cur.text());
        pit_type const beg = cur.selBegin().pit();
        pit_type const end = cur.selEnd().pit() + 1;
-       recordUndoSelection(cur);
+       cur.recordUndoSelection();
        int max_depth = (beg != 0 ? pars_[beg - 1].getMaxDepthAfter() : 0);
 
        for (pit_type pit = beg; pit != end; ++pit) {
@@ -340,7 +340,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
                return;
 
        // Ok, we have a selection.
-       recordUndoSelection(cur);
+       cur.recordUndoSelection();
 
        setFont(cur.bv(), cur.selectionBegin().top(), 
                cur.selectionEnd().top(), font, toggleall);
@@ -812,7 +812,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
 
        if (oldpar.empty() || (oldpar.size() == 1 && oldpar.isLineSeparator(0))) {
                // Delete old par.
-               recordUndo(old, Undo::ATOMIC,
+               old.recordUndo(ATOMIC_UNDO,
                           max(old.pit() - 1, pit_type(0)),
                           min(old.pit() + 1, old.lastpit()));
                ParagraphList & plist = old.text()->paragraphs();
@@ -893,13 +893,13 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra
 
 void Text::recUndo(Cursor & cur, pit_type first, pit_type last) const
 {
-       recordUndo(cur, Undo::ATOMIC, first, last);
+       cur.recordUndo(ATOMIC_UNDO, first, last);
 }
 
 
 void Text::recUndo(Cursor & cur, pit_type par) const
 {
-       recordUndo(cur, Undo::ATOMIC, par, par);
+       cur.recordUndo(ATOMIC_UNDO, par, par);
 }
 
 } // namespace lyx