]> git.lyx.org Git - features.git/commitdiff
Revert last commit. I was confusing two things.
authorRichard Heck <rgheck@comcast.net>
Tue, 13 Jul 2010 14:13:47 +0000 (14:13 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 13 Jul 2010 14:13:47 +0000 (14:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34890 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXRC.cpp
src/LyXRC.h
src/Paragraph.cpp
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/ui/PrefSpellcheckerUi.ui

index 488bdf699e53d62bef0d8d641056759437941105..4de11cc08fee1c055e03965561df332476115416 100644 (file)
@@ -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<string>(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:
index cb7d3f6aaf11d65a6198ae1e1b96c02337f0f7e0..823dc15f74463162cbc996166138d1e6a958f3d3 100644 (file)
@@ -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;
        ///
index 9ae11bb1f235ed6337d7831b3dd47bc20986fa8b..150c28d6a9adafe53b8be2cdc7d224dbf3d297e9 100644 (file)
@@ -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())
index 759562facf8931989375f033b317dfd38e8cdfef..0b37b037b4ef9db40d99bbf060004af8a6d69b23 100644 (file)
@@ -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);
 }
 
index b584a200c157e1b6dcec4da0c457593fb1b00fab..9a8f1dfb09de952527bc1cd177ee8f0e52a2417a 100644 (file)
@@ -1,33 +1,33 @@
-<ui version="4.0">
+<ui version="4.0" >
  <class>PrefSpellcheckerUi</class>
- <widget class="QWidget" name="PrefSpellcheckerUi">
-  <property name="geometry">
+ <widget class="QWidget" name="PrefSpellcheckerUi" >
+  <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
     <width>519</width>
-    <height>241</height>
+    <height>224</height>
    </rect>
   </property>
-  <property name="windowTitle">
+  <property name="windowTitle" >
    <string/>
   </property>
-  <layout class="QGridLayout">
-   <property name="margin">
+  <layout class="QGridLayout" >
+   <property name="margin" >
     <number>9</number>
    </property>
-   <property name="spacing">
+   <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="8" column="0" colspan="3">
+   <item row="6" column="0" colspan="3" >
     <spacer>
-     <property name="orientation">
+     <property name="orientation" >
       <enum>Qt::Vertical</enum>
      </property>
-     <property name="sizeType">
+     <property name="sizeType" >
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" stdset="0">
+     <property name="sizeHint" >
       <size>
        <width>501</width>
        <height>21</height>
      </property>
     </spacer>
    </item>
-   <item row="0" column="0">
-    <widget class="QLabel" name="spellcheckerLA">
-     <property name="text">
+   <item row="5" column="0" colspan="2" >
+    <widget class="QCheckBox" name="spellcheckNotesCB" >
+     <property name="toolTip" >
+      <string>If unchecked, notes and comments will be excluded from spell checking</string>
+     </property>
+     <property name="text" >
+      <string>Spellcheck &amp;notes and comments</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0" >
+    <widget class="QLabel" name="spellcheckerLA" >
+     <property name="text" >
       <string>&amp;Spellchecker engine:</string>
      </property>
-     <property name="buddy">
+     <property name="buddy" >
       <cstring>altLanguageED</cstring>
      </property>
     </widget>
    </item>
-   <item row="0" column="1">
-    <widget class="QComboBox" name="spellcheckerCB"/>
+   <item row="0" column="1" >
+    <widget class="QComboBox" name="spellcheckerCB" />
    </item>
-   <item row="3" column="0" colspan="2">
-    <widget class="QCheckBox" name="compoundWordCB">
-     <property name="toolTip">
-      <string>Accept words such as &quot;diskdrive&quot;</string>
+   <item row="3" column="0" colspan="2" >
+    <widget class="QCheckBox" name="compoundWordCB" >
+     <property name="toolTip" >
+      <string>Accept words such as "diskdrive"</string>
      </property>
-     <property name="text">
+     <property name="text" >
       <string>Accept compound &amp;words</string>
      </property>
     </widget>
    </item>
-   <item row="4" column="0" colspan="2">
-    <widget class="QCheckBox" name="spellcheckContinuouslyCB">
-     <property name="toolTip">
+   <item row="4" column="0" colspan="2" >
+    <widget class="QCheckBox" name="spellcheckContinuouslyCB" >
+     <property name="toolTip" >
       <string>Mark misspelled words with a wavy underline.</string>
      </property>
-     <property name="text">
+     <property name="text" >
       <string>S&amp;pellcheck continuously</string>
      </property>
     </widget>
    </item>
-   <item row="3" column="2">
+   <item row="3" column="2" >
     <spacer>
-     <property name="orientation">
+     <property name="orientation" >
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="sizeType">
+     <property name="sizeType" >
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" stdset="0">
+     <property name="sizeHint" >
       <size>
        <width>41</width>
        <height>22</height>
      </property>
     </spacer>
    </item>
-   <item row="2" column="1">
-    <widget class="QLineEdit" name="escapeCharactersED">
-     <property name="toolTip">
+   <item row="2" column="1" >
+    <widget class="QLineEdit" name="escapeCharactersED" >
+     <property name="toolTip" >
       <string>The characters inserted here are ignored by the spellchecker. </string>
      </property>
     </widget>
    </item>
-   <item row="2" column="0">
-    <widget class="QLabel" name="escapeCharactersLA">
-     <property name="text">
+   <item row="2" column="0" >
+    <widget class="QLabel" name="escapeCharactersLA" >
+     <property name="text" >
       <string>&amp;Escape characters:</string>
      </property>
-     <property name="buddy">
+     <property name="buddy" >
       <cstring>escapeCharactersED</cstring>
      </property>
     </widget>
    </item>
-   <item row="1" column="1">
-    <widget class="QLineEdit" name="altLanguageED">
-     <property name="toolTip">
+   <item row="1" column="1" >
+    <widget class="QLineEdit" name="altLanguageED" >
+     <property name="toolTip" >
       <string>Override the language used for the spellchecker</string>
      </property>
     </widget>
    </item>
-   <item row="1" column="0">
-    <widget class="QLabel" name="altLanguageLA">
-     <property name="text">
+   <item row="1" column="0" >
+    <widget class="QLabel" name="altLanguageLA" >
+     <property name="text" >
       <string>Al&amp;ternative language:</string>
      </property>
-     <property name="buddy">
+     <property name="buddy" >
       <cstring>altLanguageED</cstring>
      </property>
     </widget>
    </item>
-   <item row="6" column="0">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string>Minimum word length for completion</string>
-     </property>
-    </widget>
-   </item>
-   <item row="6" column="1">
-    <widget class="QSpinBox" name="minlengthSB">
-     <property name="toolTip">
-      <string/>
-     </property>
-     <property name="minimum">
-      <number>5</number>
-     </property>
-     <property name="maximum">
-      <number>15</number>
-     </property>
-     <property name="value">
-      <number>6</number>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="0">
-    <widget class="QCheckBox" name="spellcheckNotesCB">
-     <property name="toolTip">
-      <string>If unchecked, notes and comments will be excluded from spell checking</string>
-     </property>
-     <property name="text">
-      <string>Spellcheck &amp;notes and comments</string>
-     </property>
-    </widget>
-   </item>
   </layout>
  </widget>
  <tabstops>
   <tabstop>compoundWordCB</tabstop>
  </tabstops>
  <includes>
-  <include location="local">qt_i18n.h</include>
+  <include location="local" >qt_i18n.h</include>
  </includes>
  <resources/>
  <connections/>