summaryrefslogtreecommitdiff
path: root/Source/WebCore/editing/AlternativeTextController.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/editing/AlternativeTextController.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/editing/AlternativeTextController.cpp')
-rw-r--r--Source/WebCore/editing/AlternativeTextController.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/WebCore/editing/AlternativeTextController.cpp b/Source/WebCore/editing/AlternativeTextController.cpp
index 5dcfbd383..9eeee2d05 100644
--- a/Source/WebCore/editing/AlternativeTextController.cpp
+++ b/Source/WebCore/editing/AlternativeTextController.cpp
@@ -31,8 +31,10 @@
#include "Document.h"
#include "DocumentMarkerController.h"
#include "EditCommand.h"
+#include "Editor.h"
#include "EditorClient.h"
#include "Event.h"
+#include "ExceptionCodePlaceholder.h"
#include "FloatQuad.h"
#include "Frame.h"
#include "FrameView.h"
@@ -43,9 +45,9 @@
#include "TextEvent.h"
#include "TextIterator.h"
#include "VisibleSelection.h"
+#include "VisibleUnits.h"
#include "htmlediting.h"
#include "markup.h"
-#include "visible_units.h"
namespace WebCore {
@@ -337,7 +339,7 @@ void AlternativeTextController::timerFired(Timer<AlternativeTextController>*)
VisiblePosition start(selection.start(), selection.affinity());
VisiblePosition p = startOfWord(start, LeftWordIfOnBoundary);
VisibleSelection adjacentWords = VisibleSelection(p, start);
- m_frame->editor()->markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeSpelling | TextCheckingTypeShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0);
+ m_frame->editor().markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeSpelling | TextCheckingTypeReplacement | TextCheckingTypeShowCorrectionPanel, adjacentWords.toNormalizedRange().get(), 0);
}
break;
case AlternativeTextTypeReversion: {
@@ -452,7 +454,7 @@ void AlternativeTextController::respondToChangedSelection(const VisibleSelection
// containing the original pre-correction word so that user can quickly revert the
// undesired autocorrection. Here, we start correction panel timer once we confirm that
// the new caret position is at the end of a word.
- if (!currentSelection.isCaret() || currentSelection == oldSelection)
+ if (!currentSelection.isCaret() || currentSelection == oldSelection || !currentSelection.isContentEditable())
return;
VisiblePosition selectionPosition = currentSelection.start();
@@ -707,8 +709,7 @@ bool AlternativeTextController::insertDictatedText(const String& text, const Vec
RefPtr<TextEvent> event = TextEvent::createForDictation(m_frame->document()->domWindow(), text, dictationAlternatives);
event->setUnderlyingEvent(triggeringEvent);
- ExceptionCode ec;
- target->dispatchEvent(event, ec);
+ target->dispatchEvent(event, IGNORE_EXCEPTION);
return event->defaultHandled();
}
@@ -741,9 +742,9 @@ Vector<String> AlternativeTextController::dictationAlternativesForMarker(const D
void AlternativeTextController::applyDictationAlternative(const String& alternativeString)
{
#if USE(DICTATION_ALTERNATIVES)
- Editor* editor = m_frame->editor();
- RefPtr<Range> selection = editor->selectedRange();
- if (!selection || !editor->shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
+ Editor& editor = m_frame->editor();
+ RefPtr<Range> selection = editor.selectedRange();
+ if (!selection || !editor.shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
return;
DocumentMarkerController* markers = selection->startContainer()->document()->markers();
Vector<DocumentMarker*> dictationAlternativesMarkers = markers->markersInRange(selection.get(), DocumentMarker::DictationAlternatives);