]> git.lyx.org Git - lyx.git/blobdiff - src/undo.C
Two fixes involving RtL text drawing
[lyx.git] / src / undo.C
index 4afddcbaf41d235cbeba27eccf39c43a0873f98d..075697facf327a269aa10b19d4b71dc12c50558e 100644 (file)
@@ -24,7 +24,7 @@
 #include "paragraph.h"
 
 #include "mathed/math_support.h"
-#include "insets/updatableinset.h"
+#include "insets/inset.h"
 
 #include <algorithm>
 
@@ -65,8 +65,8 @@ void doRecordUndo(Undo::undo_kind kind,
        undo.cursor = cur;
        undo.bparams = bparams ;
        undo.isFullBuffer = isFullBuffer;
-       lyxerr << "recordUndo: cur: " << cur << endl;
-       lyxerr << "recordUndo: pos: " << cur.pos() << endl;
+       //lyxerr << "recordUndo: cur: " << cur << endl;
+       //lyxerr << "recordUndo: pos: " << cur.pos() << endl;
        //lyxerr << "recordUndo: cell: " << cell << endl;
        undo.from = first_pit;
        undo.end = cell.lastpit() - last_pit;
@@ -93,10 +93,10 @@ void doRecordUndo(Undo::undo_kind kind,
                // record the relevant paragraphs
                LyXText const * text = cell.text();
                BOOST_ASSERT(text);
-               ParagraphList & plist = text->paragraphs();
-               ParagraphList::iterator first = plist.begin();
+               ParagraphList const & plist = text->paragraphs();
+               ParagraphList::const_iterator first = plist.begin();
                advance(first, first_pit);
-               ParagraphList::iterator last = plist.begin();
+               ParagraphList::const_iterator last = plist.begin();
                advance(last, last_pit + 1);
                undo.pars = ParagraphList(first, last);
        }
@@ -182,8 +182,7 @@ bool textUndoOrRedo(BufferView & bv,
                ParagraphList::const_iterator pit = undo.pars.begin();
                ParagraphList::const_iterator end = undo.pars.end();
                for (; pit != end; ++pit)
-                       const_cast<Paragraph &>(*pit).setInsetOwner(
-                               dynamic_cast<UpdatableInset *>(&dit.inset()));
+                       const_cast<Paragraph &>(*pit).setInsetOwner(&dit.inset());
                plist.insert(first, undo.pars.begin(), undo.pars.end());
        }