On Thu, 2006-02-23 at 19:39 +0200, Martin Vermeer wrote:
> On Thu, Feb 23, 2006 at 06:29:05PM +0100, Jean-Marc Lasgouttes wrote:
> > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> > 
> > >> I did not try the other part.
> > 
> > Martin> But that's the actual bug fix! This part is just cosmetic (and
> > Martin> I have no strong feelings on it, except that the blue line
> > Martin> might be confusing for some users.)
> > 
> > I know :) But I do not have much time right now. And it is for 1.4.1,
> > right?
> 
> No, I would say it's for 1.4.0: we have to prevent a format change.
> Current 1.4.0svn writes out ERT insets in the buffer language rather
> than latex_language, but the user doesn't notice until it's too late.
> 
> (Georg: correct me if I am wrong on this)

Here is a better patch. I think it covers all bases; with the previous
patch is was, e.g., possible to enter text into an ERT, delete it again,
and type new text, which would then take the buffer language.

(And imagine my surprise at seeing that also text pasted into the ERT
was given the buffer language!)

- Martin

Index: insetert.C
===================================================================
--- insetert.C	(revision 13270)
+++ insetert.C	(working copy)
@@ -222,8 +222,8 @@
 		LyXLayout_ptr const layout =
 			bp.getLyXTextClass().defaultLayout();
 		LyXFont font = layout->font;
-		// We need to set the language for non-english documents
-		font.setLanguage(bp.language);
+		// We need to reset the language:
+		font.setLanguage(latex_language);
 		ParagraphList::iterator const end = paragraphs().end();
 		for (ParagraphList::iterator par = paragraphs().begin();
 		     par != end; ++par) {
@@ -238,10 +238,15 @@
 		}
 		break;
 	}
-	default:
+	default: {
+		// Force any new text to latex_language:
+		text_.current_font.setLanguage(latex_language);
+		text_.real_current_font.setLanguage(latex_language);
+
 		InsetCollapsable::doDispatch(cur, cmd);
 		break;
 	}
+	}
 }
 
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to