X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fspellchecker.C;h=fa208ce3637a4c23a1e9fa0ffb014bfea7648986;hb=bd659b25fb6e2df5d02273ee1ce4699aa5723e2e;hp=355782c7646db92a26b98a96fe35db3f6095d74e;hpb=71f8ac34a96741c40c876c66ae199f9677559a5c;p=features.git diff --git a/src/spellchecker.C b/src/spellchecker.C index 355782c764..fa208ce363 100644 --- a/src/spellchecker.C +++ b/src/spellchecker.C @@ -395,7 +395,7 @@ void init_spell_checker(BufferParams const & params, string const & lang) if (lyxrc.isp_use_input_encoding && params.inputenc != "default") { string enc = (params.inputenc == "auto") - ? params.language_info->encoding()->LatexName() + ? params.language->encoding()->LatexName() : params.inputenc; string::size_type n = enc.length(); tmp = new char[3]; @@ -806,20 +806,18 @@ bool RunSpellChecker(BufferView * bv) #ifdef USE_PSPELL string tmp = (lyxrc.isp_use_alt_lang) ? - lyxrc.isp_alt_lang : bv->buffer()->params.language_info->code(); + lyxrc.isp_alt_lang : bv->buffer()->params.language->code(); #else string tmp = (lyxrc.isp_use_alt_lang) ? - lyxrc.isp_alt_lang : bv->buffer()->GetLanguage(); + lyxrc.isp_alt_lang : bv->buffer()->params.language->lang(); #endif -#warning This is not good we should find a way to identify a rtl-language in a more general way. Please have a look Dekel! (Jug) -// For now I'll change this to a bit more general solution but -// Please comment on this if you don't like it. We probaly need -// anoter flag something like lyxrc.isp_use_alt_lang_rtl (true/false)! - bool rtl; - if (lyxrc.isp_use_alt_lang) - rtl = (tmp == "hebrew" || tmp == "arabic"); - else - rtl = bv->buffer()->params.language_info->RightToLeft(); + bool rtl = false; + if (lyxrc.isp_use_alt_lang) { + Language const * lang = languages.getLanguage(tmp); + if (lang) + rtl = lang->RightToLeft(); + } else + rtl = bv->buffer()->params.language->RightToLeft(); int oldval = 0; /* used for updating slider only when needed */ float newval = 0.0;