From: Richard Heck Date: Tue, 13 Jul 2010 14:13:47 +0000 (+0000) Subject: Revert last commit. I was confusing two things. X-Git-Tag: 2.0.0~2989 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=17166837d74c0802b244485925c2a2545f51ff2b;p=features.git Revert last commit. I was confusing two things. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34890 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index 488bdf699e..4de11cc08f 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -180,7 +180,6 @@ LexerKeyword lyxrcTags[] = { { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS }, { "\\spell_command", LyXRC::RC_SPELL_COMMAND }, { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY }, - { "\\spellcheck_minlength", LyXRC::RC_SPELL_MINLENGTH }, { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES }, { "\\spellchecker", LyXRC::RC_SPELLCHECKER }, { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND }, @@ -298,7 +297,6 @@ void LyXRC::setDefaults() #endif spellchecker_accept_compound = false; spellcheck_continuously = false; - spellcheck_minlength = 6; spellcheck_notes = true; use_kbmap = false; rtl_support = true; @@ -923,19 +921,6 @@ int LyXRC::read(Lexer & lexrc) case RC_SPELLCHECKER: lexrc >> spellchecker; break; - case RC_SPELL_MINLENGTH: { - int len; - lexrc >> len; - // make sure we have a sensible value - // these should be kept in sync with the min and max - // values for the spinbox in PrefSpellcheckerUi.ui - if (len < 5) - len = 5; - else if (len > 15) - len = 15; - spellcheck_minlength = len; - break; - } case RC_ALT_LANG: lexrc >> spellchecker_alt_lang; break; @@ -2436,15 +2421,6 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c if (tag != RC_LAST) break; - case RC_SPELL_MINLENGTH: - if (ignore_system_lyxrc || - spellcheck_minlength != system_lyxrc.spellcheck_minlength) { - os << "\\spellcheck_minlength " << convert(spellcheck_minlength) - << '\n'; - } - if (tag != RC_LAST) - break; - case RC_SPELLCHECK_NOTES: if (ignore_system_lyxrc || spellcheck_notes != system_lyxrc.spellcheck_notes) { @@ -2896,7 +2872,6 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new) case LyXRC::RC_SPELLCHECKER: case LyXRC::RC_SPELLCHECK_CONTINUOUSLY: case LyXRC::RC_SPELLCHECK_NOTES: - case LyXRC::RC_SPELL_MINLENGTH: case LyXRC::RC_SPLITINDEX_COMMAND: case LyXRC::RC_TEMPDIRPATH: case LyXRC::RC_TEMPLATEPATH: diff --git a/src/LyXRC.h b/src/LyXRC.h index cb7d3f6aaf..823dc15f74 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -165,7 +165,6 @@ public: RC_SPELLCHECK_CONTINUOUSLY, RC_SPELLCHECK_NOTES, RC_SPELLCHECKER, - RC_SPELL_MINLENGTH, RC_SPLITINDEX_COMMAND, RC_TEMPDIRPATH, RC_TEMPLATEPATH, @@ -363,8 +362,6 @@ public: bool spellcheck_continuously; /// spellcheck notes and comments? bool spellcheck_notes; - /// minimum length of words to complete - unsigned int spellcheck_minlength; /// bool use_kbmap; /// diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 9ae11bb1f2..150c28d6a9 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -3126,13 +3126,16 @@ void Paragraph::locateWord(pos_type & from, pos_type & to, void Paragraph::collectWords() { + // This is the value that needs to be exposed in the preferences + // to resolve bug #6760. + static int minlength = 6; pos_type n = size(); for (pos_type pos = 0; pos < n; ++pos) { if (isWordSeparator(pos)) continue; pos_type from = pos; locateWord(from, pos, WHOLE_WORD); - if (pos - from >= lyxrc.spellcheck_minlength) { + if (pos - from >= minlength) { docstring word = asString(from, pos, AS_STR_NONE); FontList::const_iterator cit = d->fontlist_.fontIterator(pos); if (cit == d->fontlist_.end()) diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 759562facf..0b37b037b4 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1365,7 +1365,6 @@ PrefSpellchecker::PrefSpellchecker(GuiPreferences * form) this, SIGNAL(changed())); connect(spellcheckNotesCB, SIGNAL(clicked()), this, SIGNAL(changed())); - connect(minlengthSB, SIGNAL(changed()), this, SIGNAL(changed())); #else spellcheckerCB->setEnabled(false); altLanguageED->setEnabled(false); @@ -1373,7 +1372,6 @@ PrefSpellchecker::PrefSpellchecker(GuiPreferences * form) compoundWordCB->setEnabled(false); spellcheckContinuouslyCB->setEnabled(false); spellcheckNotesCB->setEnabled(false); - minlengthSB->setEnabled(false); #endif } @@ -1386,7 +1384,6 @@ void PrefSpellchecker::apply(LyXRC & rc) const rc.spellchecker_esc_chars = fromqstr(escapeCharactersED->text()); rc.spellchecker_accept_compound = compoundWordCB->isChecked(); rc.spellcheck_continuously = spellcheckContinuouslyCB->isChecked(); - rc.spellcheck_minlength = minlengthSB->value(); rc.spellcheck_notes = spellcheckNotesCB->isChecked(); } @@ -1398,10 +1395,7 @@ void PrefSpellchecker::update(LyXRC const & rc) altLanguageED->setText(toqstr(rc.spellchecker_alt_lang)); escapeCharactersED->setText(toqstr(rc.spellchecker_esc_chars)); compoundWordCB->setChecked(rc.spellchecker_accept_compound); - bool const continuous = rc.spellcheck_continuously; - spellcheckContinuouslyCB->setChecked(continuous); - minlengthSB->setValue(rc.spellcheck_minlength); - minlengthSB->setEnabled(continuous); + spellcheckContinuouslyCB->setChecked(rc.spellcheck_continuously); spellcheckNotesCB->setChecked(rc.spellcheck_notes); } diff --git a/src/frontends/qt4/ui/PrefSpellcheckerUi.ui b/src/frontends/qt4/ui/PrefSpellcheckerUi.ui index b584a200c1..9a8f1dfb09 100644 --- a/src/frontends/qt4/ui/PrefSpellcheckerUi.ui +++ b/src/frontends/qt4/ui/PrefSpellcheckerUi.ui @@ -1,33 +1,33 @@ - + PrefSpellcheckerUi - - + + 0 0 519 - 241 + 224 - + - - + + 9 - + 6 - + - + Qt::Vertical - + QSizePolicy::Expanding - + 501 21 @@ -35,48 +35,58 @@ - - - + + + + If unchecked, notes and comments will be excluded from spell checking + + + Spellcheck &notes and comments + + + + + + &Spellchecker engine: - + altLanguageED - - + + - - - - Accept words such as "diskdrive" + + + + Accept words such as "diskdrive" - + Accept compound &words - - - + + + Mark misspelled words with a wavy underline. - + S&pellcheck continuously - + - + Qt::Horizontal - + QSizePolicy::Expanding - + 41 22 @@ -84,73 +94,40 @@ - - - + + + The characters inserted here are ignored by the spellchecker. - - - + + + &Escape characters: - + escapeCharactersED - - - + + + Override the language used for the spellchecker - - - + + + Al&ternative language: - + altLanguageED - - - - Minimum word length for completion - - - - - - - - - - 5 - - - 15 - - - 6 - - - - - - - If unchecked, notes and comments will be excluded from spell checking - - - Spellcheck &notes and comments - - - @@ -159,7 +136,7 @@ compoundWordCB - qt_i18n.h + qt_i18n.h