From 02dcf8ce10c2062ebed4b9b7bd7e6aade964a4d5 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 7 May 2015 15:56:22 +0200 Subject: [PATCH] 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 --- src/Text2.cpp | 6 +++++- status.21x | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Text2.cpp b/src/Text2.cpp index 183b58ce46..b989fd7bdc 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 76da356837..317c51d0b5 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