]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Already done
[lyx.git] / src / Cursor.cpp
index 3edf97065d34c4965be9b023a66cd07f503a36cb..9b6c82dcd852028e956cdc8ec76fbad55a406bac 100644 (file)
@@ -286,6 +286,8 @@ void Cursor::dispatch(FuncRequest const & cmd0)
        fixIfBroken();
        FuncRequest cmd = cmd0;
        Cursor safe = *this;
+
+       buffer()->undo().beginUndoGroup();
        
        // store some values to be used inside of the handlers
        beforeDispatchCursor_ = *this;
@@ -327,6 +329,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)
                // are possible which would change it
                beforeDispatchCursor_ = safe.beforeDispatchCursor_;
        }
+       buffer()->undo().endUndoGroup();
 }
 
 
@@ -2002,7 +2005,7 @@ Encoding const * Cursor::getEncoding() const
        CursorSlice const & sl = innerTextSlice();
        Text const & text = *sl.text();
        Font font = text.getPar(sl.pit()).getFont(
-               bv().buffer().params(), sl.pos(), outerFont(sl.pit(), text.paragraphs()));
+               bv().buffer().params(), sl.pos(), text.outerFont(sl.pit()));
        return font.language()->encoding();
 }
 
@@ -2059,7 +2062,7 @@ Font Cursor::getFont() const
        
        // get font at the position
        Font font = par.getFont(buffer()->params(), pos,
-               outerFont(sl.pit(), text.paragraphs()));
+               text.outerFont(sl.pit()));
 
        return font;
 }