diff options
Diffstat (limited to 'WebCore/editing/EditorCommand.cpp')
-rw-r--r-- | WebCore/editing/EditorCommand.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp index 4b8da0e..4f53ae9 100644 --- a/WebCore/editing/EditorCommand.cpp +++ b/WebCore/editing/EditorCommand.cpp @@ -132,7 +132,10 @@ static bool executeToggleStyleInList(Frame* frame, EditorCommandSource source, E { ExceptionCode ec = 0; Node* nodeToRemove = 0; - RefPtr<CSSComputedStyleDeclaration> selectionStyle = frame->selectionComputedStyle(nodeToRemove); + RefPtr<CSSComputedStyleDeclaration> selectionStyle = frame->editor()->selectionComputedStyle(nodeToRemove); + if (!selectionStyle) + return false; + RefPtr<CSSValue> selectedCSSValue = selectionStyle->getPropertyCSSValue(propertyID); String newStyle = "none"; if (selectedCSSValue->isValueList()) { @@ -375,7 +378,7 @@ static bool executeDeleteToEndOfParagraph(Frame* frame, Event*, EditorCommandSou static bool executeDeleteToMark(Frame* frame, Event*, EditorCommandSource, const String&) { - RefPtr<Range> mark = frame->mark().toNormalizedRange(); + RefPtr<Range> mark = frame->editor()->mark().toNormalizedRange(); if (mark) { SelectionController* selection = frame->selection(); bool selected = selection->setSelectedRange(unionDOMRanges(mark.get(), frame->editor()->selectedRange().get()).get(), DOWNSTREAM, true); @@ -384,7 +387,7 @@ static bool executeDeleteToMark(Frame* frame, Event*, EditorCommandSource, const return false; } frame->editor()->performDelete(); - frame->setMark(frame->selection()->selection()); + frame->editor()->setMark(frame->selection()->selection()); return true; } @@ -402,7 +405,7 @@ static bool executeDeleteWordForward(Frame* frame, Event*, EditorCommandSource, static bool executeFindString(Frame* frame, Event*, EditorCommandSource, const String& value) { - return frame->findString(value, true, false, true, false); + return frame->editor()->findString(value, true, false, true, false); } static bool executeFontName(Frame* frame, Event*, EditorCommandSource source, const String& value) @@ -951,7 +954,7 @@ static bool executeSelectSentence(Frame* frame, Event*, EditorCommandSource, con static bool executeSelectToMark(Frame* frame, Event*, EditorCommandSource, const String&) { - RefPtr<Range> mark = frame->mark().toNormalizedRange(); + RefPtr<Range> mark = frame->editor()->mark().toNormalizedRange(); RefPtr<Range> selection = frame->editor()->selectedRange(); if (!mark || !selection) { systemBeep(); @@ -968,7 +971,7 @@ static bool executeSelectWord(Frame* frame, Event*, EditorCommandSource, const S static bool executeSetMark(Frame* frame, Event*, EditorCommandSource, const String&) { - frame->setMark(frame->selection()->selection()); + frame->editor()->setMark(frame->selection()->selection()); return true; } @@ -999,14 +1002,14 @@ static bool executeSuperscript(Frame* frame, Event*, EditorCommandSource source, static bool executeSwapWithMark(Frame* frame, Event*, EditorCommandSource, const String&) { - const VisibleSelection& mark = frame->mark(); + const VisibleSelection& mark = frame->editor()->mark(); const VisibleSelection& selection = frame->selection()->selection(); if (mark.isNone() || selection.isNone()) { systemBeep(); return false; } frame->selection()->setSelection(mark); - frame->setMark(selection); + frame->editor()->setMark(selection); return true; } @@ -1150,7 +1153,7 @@ static bool enabledVisibleSelectionAndMark(Frame* frame, Event* event, EditorCom { const VisibleSelection& selection = frame->editor()->selectionForCommand(event); return ((selection.isCaret() && selection.isContentEditable()) || selection.isRange()) - && frame->mark().isCaretOrRange(); + && frame->editor()->mark().isCaretOrRange(); } static bool enableCaretInEditableText(Frame* frame, Event* event, EditorCommandSource) |