[LyX/master] Fixup aeb51be9: set current font correctly when editing inset

Jean-Marc Lasgouttes lasgouttes at lyx.org
Tue Nov 10 14:16:29 UTC 2020


commit 63300c3ba89ba1f196b8d436f09a2279d6780de0
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Tue Nov 10 15:39:47 2020 +0100

    Fixup aeb51be9: set current font correctly when editing inset
    
    When using InsetText::edit(), invoke Cursor::setCurrentFont (note that
    editXY does it already). It is a good idea in general, especially
    after commit 411333fa95, which sets languagecorrectly in ERT.
    
    This allows to comment out (again!) the trick added to fix ticket #9042.
---
 src/insets/InsetText.cpp |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index f72b9a6..ec223fa 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -280,6 +280,7 @@ void InsetText::edit(Cursor & cur, bool front, EntryDirection entry_from)
 	}
 
 	cur.top().setPitPos(pit, pos);
+	cur.setCurrentFont();
 	cur.finishUndo();
 }
 
@@ -294,6 +295,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
 	LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
 
+#if 0
 	// See bug #9042, for instance.
 	if (isPassThru()) {
 		// Force any new text to latex_language FIXME: This
@@ -305,6 +307,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 		cur.current_font.setLanguage(latex_language);
 		cur.real_current_font.setLanguage(latex_language);
 	}
+#endif
 
 	switch (cmd.action()) {
 	case LFUN_PASTE:


More information about the lyx-cvs mailing list