Author: spitz
Date: Fri Mar 18 10:17:09 2011
New Revision: 37946
URL: http://www.lyx.org/trac/changeset/37946

Log:
* InsetSpecialChar.cpp: 
        make NOBREAKDASH isLetter()

* Paragraph.cpp (isWord separator):
        handle composites with hyphens as one word (i.e., "-" is not a word 
separator).

Modified:
   lyx-devel/trunk/src/Paragraph.cpp
   lyx-devel/trunk/src/insets/InsetSpecialChar.cpp

Modified: lyx-devel/trunk/src/Paragraph.cpp
==============================================================================
--- lyx-devel/trunk/src/Paragraph.cpp   Fri Mar 18 02:28:52 2011        (r37945)
+++ lyx-devel/trunk/src/Paragraph.cpp   Fri Mar 18 10:17:09 2011        (r37946)
@@ -2850,6 +2850,14 @@
        if (pos == size())
                return true;
        char_type const c = d->text_[pos];
+       // if we have a hard hyphen (no en- or emdash),
+       // we pass this to the spell checker
+       if (c == '-') {
+               int j = pos + 1;
+               if ((j == size() || d->text_[j] != '-')
+                   && (pos == 0 || d->text_[pos - 1] != '-'))
+                       return false;
+       }
        // We want to pass the ' and escape chars to the spellchecker
        static docstring const quote = from_utf8(lyxrc.spellchecker_esc_chars + 
'\'');
        return (!isLetterChar(c) && !isDigitASCII(c) && !contains(quote, c));

Modified: lyx-devel/trunk/src/insets/InsetSpecialChar.cpp
==============================================================================
--- lyx-devel/trunk/src/insets/InsetSpecialChar.cpp     Fri Mar 18 02:28:52 
2011        (r37945)
+++ lyx-devel/trunk/src/insets/InsetSpecialChar.cpp     Fri Mar 18 10:17:09 
2011        (r37946)
@@ -342,7 +342,8 @@
 
 bool InsetSpecialChar::isLetter() const
 {
-       return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
+       return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK
+               || kind_ == NOBREAKDASH;
 }
 
 
@@ -353,7 +354,8 @@
        // Paragraph::stripLeadingSpaces nukes the characters which
        // have this property. I leave the code here, since it should
        // eventually be made to work. (JMarc 20020327)
-       return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR;
+       return kind_ == HYPHENATION || kind_ == MENU_SEPARATOR
+               || kind_ == SLASH;
 #else
        return false;
 #endif

Reply via email to