On Tue, 2006-01-24 at 14:35 +0100, Helge Hafting wrote: > This still fails my simple test. (Default LyX language is Norwegian): > > 1. New document. > 2. Change document language to Swedish instead. Noticed that changing > the language outputs "Changing language!" to the console. Debug stuff? > 3. Type some plain text, and notice the dreaded blue lines. :-( > > Looking at the .lyx file shows that LyX no longer produce the bogus > "\lang norsk". That part is improved, but the stupid underline happens > anyway. > > 4. Insert a table, it gets the strange "table-underlining" of the first row. > > Looking at the .lyx show that there still is a \lang norsk in front of > the table. :-( > Also, text inside the table (which is not underlined) gets a "\lang norsk" > in the .lyx file. This is a regression from your previous patch. > > The ui is not aware that the table cells has a wrong language, it tells > me about > the font used but nothing about language. The internal confusion in Lyx > is great. > Trying to spellcheck such a word invokes the swedish spellchecker. > Sure, the > word is supposed to be swedish but is stored as norwegian. :-/ > > 5. Mark some of the wrongly underlined swedish text (outside the table) > and try to set and reset the language. The underlining remains, wheter I > try "Swedish", "Norwegian", or "revert". There is no way of making > it go away. > > 6. save,exit,restart,open: Everything as before - the badness is at > least consistent. > > Looking forward to the next patch. Is there still confusion about > document language vs. default lyx language, or perhaps some inverted logic? > > Helge Hafting
Oops. Two chunks were missing from the patch; attached. I suspect that especially the rowpainter one makes a difference... So: apply this patch _additionally_. - Martin, who has way too much stuff in his tree
Index: rowpainter.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v retrieving revision 1.163 diff -u -p -r1.163 rowpainter.C --- rowpainter.C 16 Jan 2006 15:17:17 -0000 1.163 +++ rowpainter.C 24 Jan 2006 15:03:42 -0000 @@ -306,7 +322,7 @@ void RowPainter::paintFromPos(pos_type & { pos_type const pos = text_.bidi.vis2log(vpos); LyXFont orig_font = text_.getFont(par_, pos); - text_.applyOuterFont(orig_font); + ///text_.applyOuterFont(orig_font); double const orig_x = x_; Index: insets/insetcharstyle.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcharstyle.C,v retrieving revision 1.39 diff -u -p -r1.39 insetcharstyle.C --- insets/insetcharstyle.C 25 Nov 2005 14:40:32 -0000 1.39 +++ insets/insetcharstyle.C 24 Jan 2006 15:03:47 -0000 @@ -135,8 +138,8 @@ void InsetCharStyle::metrics(MetricsInfo { LyXFont tmpfont = mi.base.font; getDrawFont(mi.base.font); - mi.base.font.reduce(LyXFont(LyXFont::ALL_SANE)); mi.base.font.realize(tmpfont); + mi.base.font.setLanguage(tmpfont.language()); mi.base.textwidth -= 2 * TEXT_TO_INSET_OFFSET; InsetText::metrics(mi, dim); mi.base.font = tmpfont;
signature.asc
Description: This is a digitally signed message part