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
This commit is contained in:
Jean-Marc Lasgouttes 2015-05-07 15:56:22 +02:00
parent 0299b9bf71
commit 02dcf8ce10
2 changed files with 7 additions and 1 deletions

View File

@ -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) {

View File

@ -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