| Index: Source/WebCore/editing/SpellChecker.cpp
|
| ===================================================================
|
| --- Source/WebCore/editing/SpellChecker.cpp (revision 86210)
|
| +++ Source/WebCore/editing/SpellChecker.cpp (working copy)
|
| @@ -33,6 +33,7 @@
|
| #include "HTMLInputElement.h"
|
| #include "HTMLTextAreaElement.h"
|
| #include "Node.h"
|
| +#include "Page.h"
|
| #include "PositionIterator.h"
|
| #include "Range.h"
|
| #include "RenderObject.h"
|
| @@ -43,9 +44,8 @@
|
|
|
| namespace WebCore {
|
|
|
| -SpellChecker::SpellChecker(Frame* frame, TextCheckerClient* client)
|
| +SpellChecker::SpellChecker(Frame* frame)
|
| : m_frame(frame)
|
| - , m_client(client)
|
| , m_requestSequence(0)
|
| {
|
| }
|
| @@ -54,6 +54,14 @@
|
| {
|
| }
|
|
|
| +TextCheckerClient* SpellChecker::client() const
|
| +{
|
| + Page* page = m_frame->page();
|
| + if (!page)
|
| + return 0;
|
| + return page->editorClient()->textChecker();
|
| +}
|
| +
|
| bool SpellChecker::initRequest(Node* node)
|
| {
|
| ASSERT(canCheckAsynchronously(node));
|
| @@ -82,7 +90,7 @@
|
|
|
| bool SpellChecker::canCheckAsynchronously(Node* node) const
|
| {
|
| - return isCheckable(node) && isAsynchronousEnabled() && !isBusy();
|
| + return client() && isCheckable(node) && isAsynchronousEnabled() && !isBusy();
|
| }
|
|
|
| bool SpellChecker::isBusy() const
|
| @@ -106,7 +114,7 @@
|
|
|
| if (!initRequest(node))
|
| return;
|
| - m_client->requestCheckingOfString(this, m_requestSequence, mask, m_requestText);
|
| + client()->requestCheckingOfString(this, m_requestSequence, mask, m_requestText);
|
| }
|
|
|
| static bool forwardIterator(PositionIterator& iterator, int distance)
|
|
|