...and here (drum roll) is the patch...
On Mon, 2006-01-23 at 11:50 +0200, Martin Vermeer wrote: > The attached is an attempt to fix the blue underline problem that > occurs, e.g, with tabulars, and a few more irritating places. > > It also removes the kludge that semi-fixed it before (yes, I am to blame > for that one). > > Explanation: > > 1) The chunk to text.C makes the font that's handed to insets of > noFontChange() type contain the document's language, rather than the LyX > default language. This suppresses the blue lines in tabular. > > 2) The chunk to text3.C removes a kludge that is not needed anymore (and > actually covered up the real problem, and didn't always work) > > 3) The chunk to text2.C removes a kludge that became positively > undesirable :-( > > 4) The chunk to insetcharstyle.C fixes the blueline problem there, which > was caused by this inset type playing its own font games. > > Please give it a try. IMHO a lot cleaner than what we have, and this > actually works ;-) > > - Martin >
Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.637
diff -u -p -r1.637 text2.C
--- text2.C 4 Jan 2006 14:24:40 -0000 1.637
+++ text2.C 23 Jan 2006 10:06:51 -0000
@@ -208,7 +222,6 @@ void LyXText::applyOuterFont(LyXFont & f
LyXFont lf(font_);
lf.reduce(defaultfont_);
lf.realize(font);
- lf.setLanguage(font.language());
font = lf;
}
Index: text3.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v
retrieving revision 1.323
diff -u -p -r1.323 text3.C
--- text3.C 31 Dec 2005 11:40:32 -0000 1.323
+++ text3.C 23 Jan 2006 10:06:52 -0000
@@ -1114,12 +1122,6 @@ void LyXText::dispatch(LCursor & cur, Fu
cur.clearSelection();
LyXFont const old_font = real_current_font;
- // Prevents language turds in new lyxtexts under non-english
- BufferParams const & bufparams = cur.buffer().params();
- Language const * lang = cur.paragraph().getParLanguage(bufparams);
- current_font.setLanguage(lang);
- real_current_font.setLanguage(lang);
-
string::const_iterator cit = cmd.argument.begin();
string::const_iterator end = cmd.argument.end();
for (; cit != end; ++cit)
Index: text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.639
diff -u -p -r1.639 text.C
--- text.C 19 Dec 2005 12:30:33 -0000 1.639
+++ text.C 23 Jan 2006 10:06:53 -0000
@@ -1692,8 +1692,9 @@ bool LyXText::redoParagraph(pit_type con
// redo insets
// FIXME: We should always use getFont(), see documentation of
// noFontChange() in insetbase.h.
- LyXFont const tclassfont =
+ LyXFont tclassfont =
bv()->buffer()->params().getLyXTextClass().defaultfont();
+ tclassfont.setLanguage(bv()->buffer()->params().language);
InsetList::iterator ii = par.insetlist.begin();
InsetList::iterator iend = par.insetlist.end();
for (; ii != iend; ++ii) {
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 23 Jan 2006 10:06:53 -0000
@@ -135,8 +139,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
