get rid of the \use_alt_language pref, which was not used. Instead, we test whether \alt_language is empty

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30159 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-06-18 15:31:43 +00:00
parent 9cd55dbe5c
commit 889fdbd39b
6 changed files with 14 additions and 23 deletions

View File

@ -25,6 +25,9 @@ The following variables are obsoleted in 2.0
\use_personal_dictionary and \use_spell_lib (ispell support has been \use_personal_dictionary and \use_spell_lib (ispell support has been
removed) removed)
- \spellchecker_use_alt_lang (actually not used by the UI, it is as
simple to check whether the relevant variable is empty)
- \custom_export_command and \custom_export_format - \custom_export_command and \custom_export_format

View File

@ -3401,9 +3401,9 @@ int Buffer::spellCheck(DocIterator & from, DocIterator & to,
docstring word; docstring word;
while (nextWord(from, to, word)) { while (nextWord(from, to, word)) {
++progress; ++progress;
string lang_code = lyxrc.spellchecker_use_alt_lang string const lang_code = lyxrc.spellchecker_alt_lang.empty()
? lyxrc.spellchecker_alt_lang ? from.paragraph().getFontSettings(params(), from.pos()).language()->code()
: from.paragraph().getFontSettings(params(), from.pos()).language()->code(); : lyxrc.spellchecker_alt_lang;
WordLangTuple wl(word, lang_code); WordLangTuple wl(word, lang_code);
res = speller->check(wl); res = speller->check(wl);
// ... just bail out if the spellchecker reports an error. // ... just bail out if the spellchecker reports an error.

View File

@ -270,7 +270,6 @@ void LyXRC::setDefaults()
display_graphics = true; display_graphics = true;
// Spellchecker settings: // Spellchecker settings:
spellchecker_accept_compound = false; spellchecker_accept_compound = false;
spellchecker_use_alt_lang = false;
spellchecker_use_esc_chars = false; spellchecker_use_esc_chars = false;
spellcheck_continuously = false; spellcheck_continuously = false;
use_kbmap = false; use_kbmap = false;
@ -875,9 +874,6 @@ int LyXRC::read(Lexer & lexrc)
case RC_ACCEPT_COMPOUND: case RC_ACCEPT_COMPOUND:
lexrc >> spellchecker_accept_compound; lexrc >> spellchecker_accept_compound;
break; break;
case RC_USE_ALT_LANG:
lexrc >> spellchecker_use_alt_lang;
break;
case RC_USE_TOOLTIP: case RC_USE_TOOLTIP:
lexrc >> use_tooltip; lexrc >> use_tooltip;
break; break;
@ -1121,6 +1117,7 @@ int LyXRC::read(Lexer & lexrc)
case RC_SPELL_COMMAND: case RC_SPELL_COMMAND:
case RC_PERS_DICT: case RC_PERS_DICT:
case RC_PLAINTEXT_ROFF_COMMAND: case RC_PLAINTEXT_ROFF_COMMAND:
case RC_USE_ALT_LANG:
case RC_USE_INP_ENC: case RC_USE_INP_ENC:
case RC_USE_PERS_DICT: case RC_USE_PERS_DICT:
case RC_USE_SPELL_LIB: case RC_USE_SPELL_LIB:
@ -2194,11 +2191,7 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
if (tag != RC_LAST) if (tag != RC_LAST)
break; break;
case RC_USE_ALT_LANG: case RC_USE_ALT_LANG:
if (ignore_system_lyxrc || // Obsoleted in 2.0
spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
<< '\n';
}
if (tag != RC_LAST) if (tag != RC_LAST)
break; break;
case RC_ALT_LANG: case RC_ALT_LANG:

View File

@ -324,8 +324,6 @@ public:
unsigned int plaintext_linelen; unsigned int plaintext_linelen;
/// Accept compound words in spellchecker? /// Accept compound words in spellchecker?
bool spellchecker_accept_compound; bool spellchecker_accept_compound;
/// Use alternate language?
bool spellchecker_use_alt_lang;
/// Use tooltips? /// Use tooltips?
bool use_tooltip; bool use_tooltip;
/// Use pixmap cache? /// Use pixmap cache?

View File

@ -3048,9 +3048,9 @@ void Paragraph::collectWords()
if (!lyxrc.spellcheck_continuously || !speller) if (!lyxrc.spellcheck_continuously || !speller)
continue; continue;
string lang_code = lyxrc.spellchecker_use_alt_lang string const lang_code = lyxrc.spellchecker_alt_lang.empty()
? lyxrc.spellchecker_alt_lang ? getFontSettings(d->inset_owner_->buffer().params(), from).language()->code()
: getFontSettings(d->inset_owner_->buffer().params(), from).language()->code(); : lyxrc.spellchecker_alt_lang;
WordLangTuple wl(word, lang_code); WordLangTuple wl(word, lang_code);
SpellChecker::Result res = speller->check(wl); SpellChecker::Result res = speller->check(wl);
// ... just ignore any error that the spellchecker reports. // ... just ignore any error that the spellchecker reports.
@ -3093,9 +3093,9 @@ bool Paragraph::isMisspelled(pos_type pos) const
if (!speller) if (!speller)
return false; return false;
string lang_code = lyxrc.spellchecker_use_alt_lang string const lang_code = lyxrc.spellchecker_alt_lang.empty()
? lyxrc.spellchecker_alt_lang ? getFontSettings(d->inset_owner_->buffer().params(), from).language()->code()
: getFontSettings(d->inset_owner_->buffer().params(), from).language()->code(); : lyxrc.spellchecker_alt_lang;
WordLangTuple wl(word, lang_code); WordLangTuple wl(word, lang_code);
SpellChecker::Result res = speller->check(wl); SpellChecker::Result res = speller->check(wl);
// ... just ignore any error that the spellchecker reports. // ... just ignore any error that the spellchecker reports.

View File

@ -1263,9 +1263,7 @@ PrefSpellchecker::PrefSpellchecker(GuiPreferences * form)
void PrefSpellchecker::apply(LyXRC & rc) const void PrefSpellchecker::apply(LyXRC & rc) const
{ {
// FIXME: remove spellchecker_use_alt_lang
rc.spellchecker_alt_lang = fromqstr(altLanguageED->text()); rc.spellchecker_alt_lang = fromqstr(altLanguageED->text());
rc.spellchecker_use_alt_lang = !rc.spellchecker_alt_lang.empty();
// FIXME: remove spellchecker_use_esc_chars // FIXME: remove spellchecker_use_esc_chars
rc.spellchecker_esc_chars = fromqstr(escapeCharactersED->text()); rc.spellchecker_esc_chars = fromqstr(escapeCharactersED->text());
rc.spellchecker_use_esc_chars = !rc.spellchecker_esc_chars.empty(); rc.spellchecker_use_esc_chars = !rc.spellchecker_esc_chars.empty();
@ -1276,7 +1274,6 @@ void PrefSpellchecker::apply(LyXRC & rc) const
void PrefSpellchecker::update(LyXRC const & rc) void PrefSpellchecker::update(LyXRC const & rc)
{ {
// FIXME: remove spellchecker_use_alt_lang
altLanguageED->setText(toqstr(rc.spellchecker_alt_lang)); altLanguageED->setText(toqstr(rc.spellchecker_alt_lang));
// FIXME: remove spellchecker_use_esc_chars // FIXME: remove spellchecker_use_esc_chars
escapeCharactersED->setText(toqstr(rc.spellchecker_esc_chars)); escapeCharactersED->setText(toqstr(rc.spellchecker_esc_chars));