On Tue, Apr 12, 2005 at 11:05:52PM +0300, Martin Vermeer wrote:
> On Tue, Apr 12, 2005 at 10:46:35AM +0200, Alfredo Braunstein wrote:
> > Martin Vermeer wrote:
> > 
> > > BTW is the code added in this patch on the critical path for timing? I
> > > remember seeing people discussing the lyxfont copy c'tor.
> > 
> > Yes, it may well be that adding a couple of lyxfont constructions on char
> > drawing will have some impact on speed. But don't worry about that for the
> > moment, we can handle that latter.
> > 
> > Unfortunately I'm almost completely clueless wrt. lyx font handling, so I
> > cannot help you much. I can try to do some testing this weekend though.
> > 
> > Regards, Alfredo
> > 
> 
> It's in CVS. 
> 
> - Martin

I finally found also a way to fix the language "turd" behaviour in new
lyxtexts in non-english documents. The patch has a bit of brute force
over it and I am not sure that setCurrentFont was meant to be used in
this way. But it works. I suspect that real_current_font, which is used
to determine whether to display the foreign-language underline and the
L-shaped cursor, is not maintained as strictly as it should.

Anyway for now, for 1.4, this should be good enough (isn't current_font
and real_current_font supposed to go?).

- Martin

Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.286
diff -u -p -r1.286 text3.C
--- text3.C     7 Mar 2005 11:03:45 -0000       1.286
+++ text3.C     13 Apr 2005 05:15:39 -0000
@@ -1124,6 +1124,9 @@ void LyXText::dispatch(LCursor & cur, Fu
 
                cur.clearSelection();
                LyXFont const old_font = real_current_font;
+               
+               // Prevents language turds in new lyxtexts under non-english
+               setCurrentFont(cur);
 
                string::const_iterator cit = cmd.argument.begin();
                string::const_iterator end = cmd.argument.end();

Attachment: pgpkbTVnK4j5b.pgp
Description: PGP signature

Reply via email to