commit 02dcf8ce10c2062ebed4b9b7bd7e6aade964a4d5
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Thu May 7 15:56:22 2015 +0200

    Revert correctly cursor font after undo a font toggle
    
    The recordUndoSelection call was done after the modification of cursor 
font. This is bad.
    
    Fixes: #9537

diff --git a/src/Text2.cpp b/src/Text2.cpp
index 183b58c..b989fd7 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -264,6 +264,11 @@ void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
 void Text::setFont(Cursor & cur, Font const & font, bool toggleall)
 {
        LASSERT(this == cur.text(), return);
+
+       // If there is a selection, record undo before the cursor font is 
changed.
+       if (cur.selection())
+               cur.recordUndoSelection();
+
        // Set the current_font
        // Determine basis font
        FontInfo layoutfont;
@@ -289,7 +294,6 @@ void Text::setFont(Cursor & cur, Font const & font, bool 
toggleall)
                return;
 
        // Ok, we have a selection.
-       cur.recordUndoSelection();
        Font newfont = font;
 
        if (toggleall) {        
diff --git a/status.21x b/status.21x
index 76da356..317c51d 100644
--- a/status.21x
+++ b/status.21x
@@ -143,6 +143,8 @@ What's new
 
 - Fix crash when copying macros with arguments (bug 9418).
 
+- Fix cursor font after undoing a font-changing command (bug 9537).
+
 - Fix name and hint of figure captions in documents using the class aastex.
 
 - Fix output encoding information for non-TeX fonts XeTeX/LuaTeX on preview

Reply via email to