Fix wrong setting of language when only font change is requested.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21610 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-11-14 15:07:08 +00:00
parent 5093b1da04
commit 3ab1031f97

View File

@ -92,7 +92,7 @@ using support::isStrUnsignedInt;
using support::token; using support::token;
// globals... // globals...
static Font freefont(ignore_font); static Font freefont(ignore_font, ignore_language);
static bool toggleall = false; static bool toggleall = false;
static void toggleAndShow(Cursor & cur, Text * text, static void toggleAndShow(Cursor & cur, Text * text,
@ -1463,42 +1463,42 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
} }
case LFUN_FONT_EMPH: { case LFUN_FONT_EMPH: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setEmph(FONT_TOGGLE); font.fontInfo().setEmph(FONT_TOGGLE);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_BOLD: { case LFUN_FONT_BOLD: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setSeries(BOLD_SERIES); font.fontInfo().setSeries(BOLD_SERIES);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_NOUN: { case LFUN_FONT_NOUN: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setNoun(FONT_TOGGLE); font.fontInfo().setNoun(FONT_TOGGLE);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_TYPEWRITER: { case LFUN_FONT_TYPEWRITER: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setFamily(TYPEWRITER_FAMILY); // no good font.fontInfo().setFamily(TYPEWRITER_FAMILY); // no good
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_SANS: { case LFUN_FONT_SANS: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setFamily(SANS_FAMILY); font.fontInfo().setFamily(SANS_FAMILY);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_ROMAN: { case LFUN_FONT_ROMAN: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setFamily(ROMAN_FAMILY); font.fontInfo().setFamily(ROMAN_FAMILY);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
@ -1511,14 +1511,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
} }
case LFUN_FONT_UNDERLINE: { case LFUN_FONT_UNDERLINE: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
font.fontInfo().setUnderbar(FONT_TOGGLE); font.fontInfo().setUnderbar(FONT_TOGGLE);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }
case LFUN_FONT_SIZE: { case LFUN_FONT_SIZE: {
Font font(ignore_font); Font font(ignore_font, ignore_language);
setLyXSize(to_utf8(cmd.argument()), font.fontInfo()); setLyXSize(to_utf8(cmd.argument()), font.fontInfo());
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
@ -1528,8 +1528,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
Language const * lang = languages.getLanguage(to_utf8(cmd.argument())); Language const * lang = languages.getLanguage(to_utf8(cmd.argument()));
if (!lang) if (!lang)
break; break;
Font font(ignore_font); Font font(ignore_font, lang);
font.setLanguage(lang);
toggleAndShow(cur, this, font); toggleAndShow(cur, this, font);
break; break;
} }