summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
commit1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch)
tree87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
parent2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff)
downloadqtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebKit/chromium/src/ContextMenuClientImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/ContextMenuClientImpl.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
index 4491ea1ca..d35eb0e6c 100644
--- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -279,18 +279,20 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
// a mouse on a word, Chrome just needs to find a spelling marker on the word instread of spellchecking it.
if (selectedFrame->settings() && selectedFrame->settings()->asynchronousSpellCheckingEnabled()) {
RefPtr<Range> range = selectedFrame->selection()->toNormalizedRange();
- Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling);
- if (!markers.isEmpty()) {
- Vector<String> suggestions;
- for (size_t i = 0; i < markers.size(); ++i) {
- if (!markers[i]->description().isEmpty()) {
- Vector<String> descriptions;
- markers[i]->description().split('\n', descriptions);
- suggestions.append(descriptions);
+ if (range.get()) {
+ Vector<DocumentMarker*> markers = selectedFrame->document()->markers()->markersInRange(range.get(), DocumentMarker::Spelling);
+ if (!markers.isEmpty()) {
+ Vector<String> suggestions;
+ for (size_t i = 0; i < markers.size(); ++i) {
+ if (!markers[i]->description().isEmpty()) {
+ Vector<String> descriptions;
+ markers[i]->description().split('\n', descriptions);
+ suggestions.append(descriptions);
+ }
}
+ data.dictionarySuggestions = suggestions;
+ data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
}
- data.dictionarySuggestions = suggestions;
- data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame);
}
} else if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) {
data.isSpellCheckingEnabled = true;