On Fri, Dec 02, 2005 at 03:42:50PM +0100, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > Martin> From within an inset, I can confirm that indeed the default > Martin> font settings are returned when you change layout to Section. > Martin> When in the main text, ALL_INHERIT is returned as should. > > Martin> Looking at the code in Paragraph::getFontSettings, these > Martin> default settings seem to come from the font list structure. > Martin> But how did they get there in the first place? And why only > Martin> inside an inset? > > Ha! Been there, done that :) > > The result is the following one-liner patch to text2.C (the patch to > text.C does nothing except remove code that is indimidating but does > nothing). > > The problem is that the cache LyXText::current_font, which is (if I > understand correctly) the uninstantiated default font of the LyXText, > was not initialized, and thus received the default ALL_SANE (roman, > medium...) setting, instead of a good ALL_INHERIT. > > The situation now is much more credible, but touching such core code > make me nervous. Could you test that (without your other patch)? > > I think this current_font/real_current_font should eventually go away. > Also, it would be nice if defaultfont_ was either removed of > initalized to something somewhere :) >
Do you know a way to similarly initialize current language? That would fix a bug properly that I sort-of fixed a long time ago in an ugly way. (And the fix doesn't work; just make your doc language different from the default, and delete all chars in your doc, and start writing again). The patch works fine BTW in what little testing I did. - Martin
pgpm8KebZHKhP.pgp
Description: PGP signature