<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[43097] tags/Safari-6530.8</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/43097">43097</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2009-04-30 14:38:28 -0700 (Thu, 30 Apr 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge r43039.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#tagsSafari65308WebCoreChangeLog">tags/Safari-6530.8/WebCore/ChangeLog</a></li>
<li><a href="#tagsSafari65308WebCoreeditingEditorcpp">tags/Safari-6530.8/WebCore/editing/Editor.cpp</a></li>
<li><a href="#tagsSafari65308WebCoreeditingEditorh">tags/Safari-6530.8/WebCore/editing/Editor.h</a></li>
<li><a href="#tagsSafari65308WebCoreeditingTypingCommandcpp">tags/Safari-6530.8/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#tagsSafari65308WebKitmacChangeLog">tags/Safari-6530.8/WebKit/mac/ChangeLog</a></li>
<li><a href="#tagsSafari65308WebKitmacWebViewWebHTMLViewmm">tags/Safari-6530.8/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#tagsSafari65308WebKitmacWebViewWebViewmm">tags/Safari-6530.8/WebKit/mac/WebView/WebView.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="tagsSafari65308WebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebCore/ChangeLog (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebCore/ChangeLog        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebCore/ChangeLog        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2009-04-29  Douglas Davidson  &lt;ddavidso@apple.com&gt;
+
+        Reviewed by Justin Garcia.
+
+        &lt;rdar://problem/6836921&gt; Mail exhibits issues with text checking, e.g. menu items not always validated correctly
+        
+        Updates to the text checking code to enable text checking even if spellchecking is turned off 
+        and fix an off-by-one error in selection handling.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::markMisspellingsAfterTypingToPosition):
+        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
+        (WebCore::Editor::markMisspellingsAndBadGrammar):
+        * editing/Editor.h:
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::markMisspellingsAfterTyping):
+
</ins><span class="cx"> 2009-04-29  David Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Dan Bernstein.
</span></span></pre></div>
<a id="tagsSafari65308WebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebCore/editing/Editor.cpp (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebCore/editing/Editor.cpp        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebCore/editing/Editor.cpp        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -2156,18 +2156,28 @@
</span><span class="cx"> 
</span><span class="cx"> void Editor::markMisspellingsAfterTypingToPosition(const VisiblePosition &amp;p)
</span><span class="cx"> {
</span><del>-    if (!isContinuousSpellCheckingEnabled())
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
+    bool markSpelling = isContinuousSpellCheckingEnabled();
+    bool markGrammar = markSpelling &amp;&amp; isGrammarCheckingEnabled();
+    bool performTextCheckingReplacements = isAutomaticQuoteSubstitutionEnabled() 
+                                        || isAutomaticLinkDetectionEnabled()
+                                        || isAutomaticDashSubstitutionEnabled()
+                                        || isAutomaticTextReplacementEnabled()
+                                        || (markSpelling &amp;&amp; isAutomaticSpellingCorrectionEnabled());
+    if (!markSpelling &amp;&amp; !performTextCheckingReplacements)
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-#if PLATFORM(MAC) &amp;&amp; !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
</del><span class="cx">     VisibleSelection adjacentWords = VisibleSelection(startOfWord(p, LeftWordIfOnBoundary), endOfWord(p, RightWordIfOnBoundary));
</span><del>-    if (isGrammarCheckingEnabled()) {
</del><ins>+    if (markGrammar) {
</ins><span class="cx">         VisibleSelection selectedSentence = VisibleSelection(startOfSentence(p), endOfSentence(p));
</span><del>-        markAllMisspellingsAndBadGrammarInRanges(adjacentWords.toNormalizedRange().get(), true, selectedSentence.toNormalizedRange().get(), true);
</del><ins>+        markAllMisspellingsAndBadGrammarInRanges(true, adjacentWords.toNormalizedRange().get(), true, selectedSentence.toNormalizedRange().get(), performTextCheckingReplacements);
</ins><span class="cx">     } else {
</span><del>-        markAllMisspellingsAndBadGrammarInRanges(adjacentWords.toNormalizedRange().get(), false, adjacentWords.toNormalizedRange().get(), true);
</del><ins>+        markAllMisspellingsAndBadGrammarInRanges(markSpelling, adjacentWords.toNormalizedRange().get(), false, adjacentWords.toNormalizedRange().get(), performTextCheckingReplacements);
</ins><span class="cx">     }
</span><span class="cx"> #else
</span><ins>+    if (!isContinuousSpellCheckingEnabled())
+        return;
+    
</ins><span class="cx">     // Check spelling of one word
</span><span class="cx">     markMisspellings(VisibleSelection(startOfWord(p, LeftWordIfOnBoundary), endOfWord(p, RightWordIfOnBoundary)));
</span><span class="cx">     
</span><span class="lines">@@ -2249,7 +2259,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
</span><span class="cx"> 
</span><del>-void Editor::markAllMisspellingsAndBadGrammarInRanges(Range* spellingRange, bool markGrammar, Range* grammarRange, bool performTextCheckingReplacements)
</del><ins>+void Editor::markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* spellingRange, bool markGrammar, Range* grammarRange, bool performTextCheckingReplacements)
</ins><span class="cx"> {
</span><span class="cx">     // This function is called with selections already expanded to word boundaries.
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="lines">@@ -2298,13 +2308,17 @@
</span><span class="cx">             if (!ec) {
</span><span class="cx">                 selectionOffset = TextIterator::rangeLength(offsetAsRange.get());
</span><span class="cx">                 restoreSelectionAfterChange = true;         
</span><del>-                adjustSelectionForParagraphBoundaries = (selectionOffset &gt;= paragraphLength) ? true : false;
</del><ins>+                adjustSelectionForParagraphBoundaries = (selectionOffset &gt; paragraphLength) ? true : false;
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     Vector&lt;TextCheckingResult&gt; results;
</span><del>-    uint64_t checkingTypes = markGrammar ? (TextCheckingTypeSpelling | TextCheckingTypeGrammar) : TextCheckingTypeSpelling;
</del><ins>+    uint64_t checkingTypes = 0;
+    if (markSpelling)
+        checkingTypes |= TextCheckingTypeSpelling;
+    if (markGrammar)
+        checkingTypes |= TextCheckingTypeGrammar;
</ins><span class="cx">     if (performTextCheckingReplacements) {
</span><span class="cx">         if (isAutomaticLinkDetectionEnabled())
</span><span class="cx">             checkingTypes |= TextCheckingTypeLink;
</span><span class="lines">@@ -2314,7 +2328,7 @@
</span><span class="cx">             checkingTypes |= TextCheckingTypeDash;
</span><span class="cx">         if (isAutomaticTextReplacementEnabled())
</span><span class="cx">             checkingTypes |= TextCheckingTypeReplacement;
</span><del>-        if (isAutomaticSpellingCorrectionEnabled())
</del><ins>+        if (markSpelling &amp;&amp; isAutomaticSpellingCorrectionEnabled())
</ins><span class="cx">             checkingTypes |= TextCheckingTypeCorrection;
</span><span class="cx">     }
</span><span class="cx">     client()-&gt;checkTextOfParagraph(paragraphString.characters(), paragraphLength, checkingTypes, results);
</span><span class="lines">@@ -2323,7 +2337,7 @@
</span><span class="cx">         const TextCheckingResult* result = &amp;results[i];
</span><span class="cx">         int resultLocation = result-&gt;location + offsetDueToReplacement;
</span><span class="cx">         int resultLength = result-&gt;length;
</span><del>-        if (result-&gt;type == TextCheckingTypeSpelling &amp;&amp; resultLocation &gt;= spellingRangeStartOffset &amp;&amp; resultLocation + resultLength &lt;= spellingRangeEndOffset) {
</del><ins>+        if (markSpelling &amp;&amp; result-&gt;type == TextCheckingTypeSpelling &amp;&amp; resultLocation &gt;= spellingRangeStartOffset &amp;&amp; resultLocation + resultLength &lt;= spellingRangeEndOffset) {
</ins><span class="cx">             ASSERT(resultLength &gt; 0 &amp;&amp; resultLocation &gt;= 0);
</span><span class="cx">             RefPtr&lt;Range&gt; misspellingRange = TextIterator::subrange(spellingRange, resultLocation - spellingRangeStartOffset, resultLength);
</span><span class="cx">             misspellingRange-&gt;startContainer(ec)-&gt;document()-&gt;addMarker(misspellingRange.get(), DocumentMarker::Spelling);
</span><span class="lines">@@ -2396,7 +2410,7 @@
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
</span><span class="cx">     if (!isContinuousSpellCheckingEnabled())
</span><span class="cx">         return;
</span><del>-    markAllMisspellingsAndBadGrammarInRanges(spellingSelection.toNormalizedRange().get(), markGrammar &amp;&amp; isGrammarCheckingEnabled(), grammarSelection.toNormalizedRange().get(), false);
</del><ins>+    markAllMisspellingsAndBadGrammarInRanges(true, spellingSelection.toNormalizedRange().get(), markGrammar &amp;&amp; isGrammarCheckingEnabled(), grammarSelection.toNormalizedRange().get(), false);
</ins><span class="cx"> #else
</span><span class="cx">     markMisspellings(spellingSelection);
</span><span class="cx">     if (markGrammar)
</span></span></pre></div>
<a id="tagsSafari65308WebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebCore/editing/Editor.h (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebCore/editing/Editor.h        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebCore/editing/Editor.h        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">     void toggleAutomaticTextReplacement();
</span><span class="cx">     bool isAutomaticSpellingCorrectionEnabled();
</span><span class="cx">     void toggleAutomaticSpellingCorrection();
</span><del>-    void markAllMisspellingsAndBadGrammarInRanges(Range* spellingRange, bool markGrammar, Range* grammarRange, bool performTextCheckingReplacements);
</del><ins>+    void markAllMisspellingsAndBadGrammarInRanges(bool markSpelling, Range* spellingRange, bool markGrammar, Range* grammarRange, bool performTextCheckingReplacements);
</ins><span class="cx"> #endif
</span><span class="cx">     void advanceToNextMisspelling(bool startBeforeSelection = false);
</span><span class="cx">     void showSpellingGuessPanel();
</span></span></pre></div>
<a id="tagsSafari65308WebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebCore/editing/TypingCommand.cpp (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebCore/editing/TypingCommand.cpp        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebCore/editing/TypingCommand.cpp        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -281,8 +281,17 @@
</span><span class="cx"> 
</span><span class="cx"> void TypingCommand::markMisspellingsAfterTyping()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(MAC) &amp;&amp; !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
+    if (!document()-&gt;frame()-&gt;editor()-&gt;isContinuousSpellCheckingEnabled()
+     &amp;&amp; !document()-&gt;frame()-&gt;editor()-&gt;isAutomaticQuoteSubstitutionEnabled()
+     &amp;&amp; !document()-&gt;frame()-&gt;editor()-&gt;isAutomaticLinkDetectionEnabled()
+     &amp;&amp; !document()-&gt;frame()-&gt;editor()-&gt;isAutomaticDashSubstitutionEnabled()
+     &amp;&amp; !document()-&gt;frame()-&gt;editor()-&gt;isAutomaticTextReplacementEnabled())
+        return;
+#else
</ins><span class="cx">     if (!document()-&gt;frame()-&gt;editor()-&gt;isContinuousSpellCheckingEnabled())
</span><span class="cx">         return;
</span><ins>+#endif
</ins><span class="cx">     // Take a look at the selection that results after typing and determine whether we need to spellcheck. 
</span><span class="cx">     // Since the word containing the current selection is never marked, this does a check to
</span><span class="cx">     // see if typing made a new word that is not in the current selection. Basically, you
</span></span></pre></div>
<a id="tagsSafari65308WebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebKit/mac/ChangeLog (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebKit/mac/ChangeLog        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebKit/mac/ChangeLog        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2009-04-29  Douglas Davidson  &lt;ddavidso@apple.com&gt;
+
+        Reviewed by Justin Garcia.
+        
+        &lt;rdar://problem/6836921&gt; Mail exhibits issues with text checking, e.g. menu items not always validated correctly
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]):
+        (-[WebHTMLView orderFrontSubstitutionsPanel:]):
+        * WebView/WebView.mm:
+        (-[WebView validateUserInterfaceItemWithoutDelegate:]):
+
</ins><span class="cx"> 2009-04-28  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by John Sullivan.
</span></span></pre></div>
<a id="tagsSafari65308WebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebKit/mac/WebView/WebHTMLView.mm (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebKit/mac/WebView/WebHTMLView.mm        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebKit/mac/WebView/WebHTMLView.mm        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -2659,6 +2659,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
</span><ins>+    if (action == @selector(orderFrontSubstitutionsPanel:)) {
+        NSMenuItem *menuItem = (NSMenuItem *)item;
+        if ([menuItem isKindOfClass:[NSMenuItem class]]) {
+            BOOL panelShowing = [[[NSSpellChecker sharedSpellChecker] substitutionsPanel] isVisible];
+            [menuItem setTitle:panelShowing
+                ? UI_STRING(&quot;Hide Substitutions&quot;, &quot;menu item title&quot;)
+                : UI_STRING(&quot;Show Substitutions&quot;, &quot;menu item title&quot;)];
+        }
+        return [self _canEdit];
+    }
</ins><span class="cx">     // FIXME 4799134: WebView is the bottleneck for this logic, but we must validate 
</span><span class="cx">     // the selector here because we implement it here, and we must implement it here because the AppKit 
</span><span class="cx">     // code checks the first responder.
</span><span class="lines">@@ -4992,6 +5002,24 @@
</span><span class="cx"> 
</span><span class="cx"> #if !defined(BUILDING_ON_TIGER) &amp;&amp; !defined(BUILDING_ON_LEOPARD)
</span><span class="cx"> 
</span><ins>+- (void)orderFrontSubstitutionsPanel:(id)sender
+{
+    COMMAND_PROLOGUE
+
+    NSSpellChecker *checker = [NSSpellChecker sharedSpellChecker];
+    if (!checker) {
+        LOG_ERROR(&quot;No NSSpellChecker&quot;);
+        return;
+    }
+    
+    NSPanel *substitutionsPanel = [checker substitutionsPanel];
+    if ([substitutionsPanel isVisible]) {
+        [substitutionsPanel orderOut:sender];
+        return;
+    }
+    [substitutionsPanel orderFront:sender];
+}
+
</ins><span class="cx"> // FIXME 4799134: WebView is the bottleneck for this logic, but we must implement these methods here because
</span><span class="cx"> // the AppKit code checks the first responder.
</span><span class="cx"> 
</span></span></pre></div>
<a id="tagsSafari65308WebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: tags/Safari-6530.8/WebKit/mac/WebView/WebView.mm (43096 => 43097)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-6530.8/WebKit/mac/WebView/WebView.mm        2009-04-30 21:38:01 UTC (rev 43096)
+++ tags/Safari-6530.8/WebKit/mac/WebView/WebView.mm        2009-04-30 21:38:28 UTC (rev 43097)
</span><span class="lines">@@ -252,6 +252,7 @@
</span><span class="cx"> macro(moveWordRight) \
</span><span class="cx"> macro(moveWordRightAndModifySelection) \
</span><span class="cx"> macro(outdent) \
</span><ins>+macro(orderFrontSubstitutionsPanel) \
</ins><span class="cx"> macro(pageDown) \
</span><span class="cx"> macro(pageDownAndModifySelection) \
</span><span class="cx"> macro(pageUp) \
</span><span class="lines">@@ -3746,6 +3747,13 @@
</span><span class="cx">             [menuItem setState:checkMark ? NSOnState : NSOffState];
</span><span class="cx">         }
</span><span class="cx">         return retVal;
</span><ins>+    } else if (action == @selector(toggleSmartInsertDelete:)) {
+        BOOL checkMark = [self smartInsertDeleteEnabled];
+        if ([(NSObject *)item isKindOfClass:[NSMenuItem class]]) {
+            NSMenuItem *menuItem = (NSMenuItem *)item;
+            [menuItem setState:checkMark ? NSOnState : NSOffState];
+        }
+        return YES;
</ins><span class="cx"> #ifndef BUILDING_ON_TIGER
</span><span class="cx">     } else if (action == @selector(toggleGrammarChecking:)) {
</span><span class="cx">         BOOL checkMark = [self isGrammarCheckingEnabled];
</span></span></pre>
</div>
</div>

</body>
</html>