X-Git-Url: https://git.webkit.org/?p=WebKit-https.git;a=blobdiff_plain;f=WebCore%2Fediting%2Fmac%2FEditorMac.mm;h=7bb4e3b121c8c8c66aab17d1429d2a3b87465034;hp=5932591c60601da30d1600377d79f2c979ea9955;hb=d52ffbc226953690e24a585599eb30d6fd348592;hpb=b71d69d0a413a283e21c00047b78a1080422216b diff --git a/WebCore/editing/mac/EditorMac.mm b/WebCore/editing/mac/EditorMac.mm index 5932591c6060..7bb4e3b121c8 100644 --- a/WebCore/editing/mac/EditorMac.mm +++ b/WebCore/editing/mac/EditorMac.mm @@ -30,12 +30,39 @@ #include "Clipboard.h" #include "ClipboardMac.h" +#ifdef BUILDING_ON_TIGER +@interface NSSpellChecker (NotYetPublicMethods) +- (void)learnWord:(NSString *)word; +@end +#endif + namespace WebCore { PassRefPtr Editor::newGeneralClipboard(ClipboardAccessPolicy policy) { - RefPtr clipboard = new ClipboardMac(false, [NSPasteboard generalPasteboard], policy); - return clipboard.release(); + return new ClipboardMac(false, [NSPasteboard generalPasteboard], policy); } +NSString* Editor::userVisibleString(NSURL* nsURL) +{ + if (client()) + return client()->userVisibleString(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