Reviewed by Geoff Garen
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2006 23:48:04 +0000 (23:48 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2006 23:48:04 +0000 (23:48 +0000)
        * page/Frame.h:
        remove declarations of ignoreSpelling() and learnSpelling()

        * bridge/mac/FrameMac.h:
        remove declarations of ignoreSpelling() and learnSpelling()
        * bridge/mac/FrameMac.mm:
        moved implementations of ignoreSpelling() and learnSpelling() from here

        * editing/Editor.h:
        added declarations of ignoreSpelling() and learnSpelling()

        * editing/mac/EditorMac.mm:
        (WebCore::Editor::ignoreSpelling):
        moved here from FrameMac.mm
        (WebCore::Editor::learnSpelling):
        ditto

        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected):
        updated callers to use frame()->editor() rather than frame()

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18035 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/editing/Editor.h
WebCore/editing/mac/EditorMac.mm
WebCore/page/ContextMenuController.cpp
WebCore/page/Frame.h

index b941b9a46f0440ae44118de62935620266bbd17d..5af308b96f8277aa83b9f40a698ffa52c715b548 100644 (file)
@@ -1,3 +1,28 @@
+2006-12-05  John Sullivan  <sullivan@apple.com>
+
+        Reviewed by Geoff Garen
+
+        * page/Frame.h:
+        remove declarations of ignoreSpelling() and learnSpelling()
+
+        * bridge/mac/FrameMac.h:
+        remove declarations of ignoreSpelling() and learnSpelling()
+        * bridge/mac/FrameMac.mm:
+        moved implementations of ignoreSpelling() and learnSpelling() from here
+
+        * editing/Editor.h:
+        added declarations of ignoreSpelling() and learnSpelling()
+
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::ignoreSpelling):
+        moved here from FrameMac.mm
+        (WebCore::Editor::learnSpelling):
+        ditto
+
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::contextMenuItemSelected):
+        updated callers to use frame()->editor() rather than frame()
+
 2006-12-05  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Adam
index 7f33bbee4ffe787e16fd28178412c15afa2f9f65..44998dd54243ef27507756825fa6c9eb0564edc1 100644 (file)
@@ -165,8 +165,6 @@ public:
     
     NSWritingDirection baseWritingDirectionForSelectionStart() const;
 
-    virtual void ignoreSpelling();
-    virtual void learnSpelling();
     virtual bool isSelectionUngrammatical();
     virtual bool isSelectionMisspelled();
     virtual Vector<String> guessesForMisspelledSelection();
index b32d53b56eb01a563c0154cca0c57d5eae525f97..680907975b7b140a6be198fea99aff7db39658ca 100644 (file)
 - (NPObject *)createPluginScriptableObject;
 @end
 
-#ifndef BUILDING_ON_TIGER
-@interface NSSpellChecker (UpcomingAPI)
-- (void)updateSpellingPanelWithGrammarString:(NSString *)grammarString detail:(NSDictionary *)grammarDetail;
-@end
-#endif
-
-@interface NSSpellChecker (CurrentlyPrivateForTextView)
-- (void)learnWord:(NSString *)word;
-@end
-
 using namespace std;
 using namespace KJS::Bindings;
 
@@ -1207,21 +1197,6 @@ void FrameMac::issueTransposeCommand()
     [_bridge issueTransposeCommand];
 }
 
-void FrameMac::ignoreSpelling()
-{
-    String text = selectedText();
-    ASSERT(text.length() != 0);
-    [[NSSpellChecker sharedSpellChecker] ignoreWord:text 
-        inSpellDocumentWithTag:editor()->spellCheckerDocumentTag()];
-}
-
-void FrameMac::learnSpelling()
-{
-    String text = selectedText();
-    ASSERT(text.length() != 0);
-    [[NSSpellChecker sharedSpellChecker] learnWord:text];
-}
-
 bool FrameMac::isSelectionMisspelled()
 {
     String selectedString = selectedText();
index e434ec1cb9369aaa0fa095a472019e1ef43fbf87..fe8f3c0a9bba4ad07917891ae155586381f90b35 100644 (file)
@@ -118,6 +118,8 @@ public:
     
     bool isContinuousSpellCheckingEnabled();
     bool isGrammarCheckingEnabled();
+    void ignoreSpelling();
+    void learnSpelling();
     int spellCheckerDocumentTag();
 
     bool shouldBeginEditing(Range* range);
index af836e73d766c1433c164b8d9d676b3a13a9889f..25cd5b24b1f56f91868e029995d04251956d39b8 100644 (file)
@@ -44,4 +44,19 @@ NSString* Editor::userVisibleString(NSURL* nsURL)
     return nil;
 }
 
+void Editor::ignoreSpelling()
+{
+    String text = frame()->selectedText();
+    ASSERT(text.length() != 0);
+    [[NSSpellChecker sharedSpellChecker] ignoreWord:text 
+                             inSpellDocumentWithTag:spellCheckerDocumentTag()];
+}
+
+void Editor::learnSpelling()
+{
+    String text = frame()->selectedText();
+    ASSERT(text.length() != 0);
+    [[NSSpellChecker sharedSpellChecker] learnWord:text];
+}
+    
 } // namespace WebCore
index 5bc77e65b4d540513c5dfe72563da2d58fa95bd6..e35ece211115bd4495cb33271a2e343ad7cdb32d 100644 (file)
@@ -193,10 +193,10 @@ void ContextMenuController::contextMenuItemSelected(ContextMenuItem* item)
             }
             break;
         case ContextMenuItemTagIgnoreSpelling:
-            frame->ignoreSpelling();
+            frame->editor()->ignoreSpelling();
             break;
         case ContextMenuItemTagLearnSpelling:
-            frame->learnSpelling();
+            frame->editor()->learnSpelling();
             break;
         case ContextMenuItemTagSearchInSpotlight:
 #if PLATFORM(MAC)
index 47e85124fec5916163c25db5911a3e58aff631ad..393069976e7c78858ecb8eec8dced46b51ea5f76 100644 (file)
@@ -256,8 +256,6 @@ public:
     void applyEditingStyleToElement(Element*) const;
     void removeEditingStyleFromElement(Element*) const;
 
-    virtual void ignoreSpelling() = 0;
-    virtual void learnSpelling() = 0;
     virtual bool isSelectionUngrammatical() = 0;
     virtual bool isSelectionMisspelled() = 0;
     virtual Vector<String> guessesForMisspelledSelection() = 0;