diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-03 09:55:33 +0100 |
commit | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (patch) | |
tree | 8d89889ba95ed6ec9322e733846cc9cce9d7dff1 /Source/WebKit/chromium/src/EditorClientImpl.cpp | |
parent | d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (diff) | |
download | qtwebkit-cd44dc59cdfc39534aef4d417e9f3c412e3be139.tar.gz |
Imported WebKit commit fce473cb4d55aa9fe9d0b0322a2fffecb731b961 (http://svn.webkit.org/repository/webkit/trunk@106560)
Diffstat (limited to 'Source/WebKit/chromium/src/EditorClientImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/EditorClientImpl.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 5fa237852..04aa719ed 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. - * Copyright (C) 2010 Google, Inc. All rights reserved. + * Copyright (C) 2012 Google, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,6 +57,7 @@ #include "WebSpellCheckClient.h" #include "WebTextAffinity.h" #include "WebTextCheckingCompletionImpl.h" +#include "WebTextCheckingResult.h" #include "WebViewClient.h" #include "WebViewImpl.h" @@ -765,6 +766,22 @@ void EditorClientImpl::checkGrammarOfString(const UChar*, int length, *badGrammarLength = 0; } +void EditorClientImpl::checkTextOfParagraph(const UChar* text, int length, + TextCheckingTypeMask mask, + WTF::Vector<TextCheckingResult>& results) +{ + if (!m_webView->spellCheckClient()) + return; + + WebTextCheckingTypeMask webMask = static_cast<WebTextCheckingTypeMask>(mask); + WebVector<WebTextCheckingResult> webResults; + m_webView->spellCheckClient()->checkTextOfParagraph(WebString(text, length), webMask, &webResults); + + results.resize(webResults.size()); + for (size_t i = 0; i < webResults.size(); ++i) + results[i] = webResults[i]; +} + void EditorClientImpl::updateSpellingUIWithGrammarString(const String&, const GrammarDetail& detail) { |