Changeset 448 for trunk/ICeCoffEE
- Timestamp:
- 03/10/08 10:59:02 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEWebKit.m
r446 r448 37 37 @end 38 38 39 // from WebViewPrivate.h (will become public, part of WebViewEditing) 40 @interface WebView (webViewGrammarChecking) 41 - (BOOL)isGrammarCheckingEnabled; 42 - (void)setGrammarCheckingEnabled:(BOOL)flag; 43 @end 44 39 45 @implementation ICeCoffEEWebKit 40 46 … … 80 86 WebView *webView = [(WebHTMLView *)self _webView]; 81 87 BOOL isEditable = [webView isEditable]; 88 BOOL isContinuousSpellCheckingEnabled = NO, isGrammarCheckingEnabled = NO; 82 89 83 90 if (isEditable) { … … 92 99 93 100 @try { 94 if (!isEditable) 101 if (!isEditable) { 95 102 [webView setEditable: YES]; 103 104 // don't want spelling/grammar marks to persist when view is made uneditable again 105 if ([webView respondsToSelector: @selector(isContinuousSpellCheckingEnabled)] && 106 (isContinuousSpellCheckingEnabled = [webView isContinuousSpellCheckingEnabled])) { 107 if ([webView respondsToSelector: @selector(setContinuousSpellCheckingEnabled:)]) 108 [webView setContinuousSpellCheckingEnabled: NO]; 109 else 110 isContinuousSpellCheckingEnabled = NO; // don't restore 111 } 112 113 if ([webView respondsToSelector: @selector(isGrammarCheckingEnabled)] && 114 (isGrammarCheckingEnabled = [webView isGrammarCheckingEnabled])) { 115 if ([webView respondsToSelector: @selector(setGrammarCheckingEnabled:)]) 116 [webView setGrammarCheckingEnabled: NO]; 117 else 118 isGrammarCheckingEnabled = NO; // don't restore 119 } 120 } 121 96 122 97 123 NSPoint viewClickPt = [webView convertPoint: downPt fromView: nil]; … … 162 188 [selectedRange release]; selectedRange = nil; 163 189 [downEvent release]; downEvent = nil; 164 if (!isEditable) 190 if (!isEditable) { 165 191 [webView setEditable: NO]; 192 if (isContinuousSpellCheckingEnabled) 193 [webView setContinuousSpellCheckingEnabled: YES]; 194 if (isGrammarCheckingEnabled) 195 [webView setGrammarCheckingEnabled: YES]; 196 } 166 197 } 167 198
Note:
See TracChangeset
for help on using the changeset viewer.