]> git.lyx.org Git - lyx.git/blobdiff - src/support/AppleSpeller.m
Add quote style information to languages
[lyx.git] / src / support / AppleSpeller.m
index b516e653fff1cb9a651d899d104d751685fc42be..82901f4664768591a9a9dc3b45f17c98650dc7db 100644 (file)
@@ -115,7 +115,11 @@ SpellCheckResult AppleSpeller_check(AppleSpeller speller, const char * word, con
                                        result = SPELL_CHECK_LEARNED;
                        }
                } else {
+#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
                        NSUInteger capacity = [speller->misspelled count] + 1;
+#else
+                       int capacity = [speller->misspelled count] + 1;
+#endif
                        NSMutableArray * misspelled = [NSMutableArray arrayWithCapacity:capacity];
                        [misspelled addObjectsFromArray:speller->misspelled];
                        [misspelled addObject:[NSValue valueWithRange:match]];
@@ -233,7 +237,11 @@ int AppleSpeller_numMisspelledWords(AppleSpeller speller)
 
 void AppleSpeller_misspelledWord(AppleSpeller speller, int index, int * start, int * length)
 {
+#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
        NSRange range = [[speller->misspelled objectAtIndex:(NSUInteger)index] rangeValue];
+#else
+       NSRange range = [[speller->misspelled objectAtIndex:index] rangeValue];
+#endif
        *start = range.location;
        *length = range.length;
 }
@@ -241,5 +249,9 @@ void AppleSpeller_misspelledWord(AppleSpeller speller, int index, int * start, i
 
 int AppleSpeller_hasLanguage(AppleSpeller speller, const char * lang)
 {
+#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
        return toLanguage(speller, lang) != nil;
+#else
+       return true;
+#endif
 }