WebCore:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2007 18:13:54 +0000 (18:13 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2007 18:13:54 +0000 (18:13 +0000)
        Reviewed by Darin.

        Added DeleteWordBackward and DeleteWordForward to execCommand.

        * editing/Editor.cpp:
        (WebCore::execDeleteWordBackward):
        (WebCore::execDeleteWordForward):
        (WebCore::CommandEntry::):

WebKit:

        Reviewed by Darin.

        Call execCommand for deleteWordForward and deleteWordBackward instead of calling
        deleteWithDirection directly.

        * WebView/WebHTMLView.mm:
        (-[WebHTMLView deleteWordForward:]):
        (-[WebHTMLView deleteWordBackward:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20615 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/editing/Editor.cpp
WebKit/ChangeLog
WebKit/WebView/WebHTMLView.mm

index f0e3282521a6ba286383cb48a0e9ab5cdec4f168..dd2a501db5997588dfab92d403435023cff12efe 100644 (file)
@@ -1,3 +1,14 @@
+2007-03-30  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Added DeleteWordBackward and DeleteWordForward to execCommand.
+
+        * editing/Editor.cpp:
+        (WebCore::execDeleteWordBackward):
+        (WebCore::execDeleteWordForward):
+        (WebCore::CommandEntry::):
+
 2007-03-30  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Zack
index 9829dc7c4d03ba74b64ce38efe529b291eb6ea9b..068d0602b17e2ed6f7ead41dd548cde0f16d6d18 100644 (file)
@@ -786,6 +786,18 @@ static bool execDelete(Frame* frame, Event*)
     return true;
 }
 
+static bool execDeleteWordBackward(Frame* frame, Event*)
+{
+    frame->editor()->deleteWithDirection(SelectionController::BACKWARD, WordGranularity, true, false);
+    return true;
+}
+
+static bool execDeleteWordForward(Frame* frame, Event*)
+{
+    frame->editor()->deleteWithDirection(SelectionController::FORWARD, WordGranularity, true, false);
+    return true;
+}
+
 static bool execBackwardDelete(Frame* frame, Event*)
 {
     frame->editor()->deleteWithDirection(SelectionController::BACKWARD, CharacterGranularity, false, true);
@@ -1206,6 +1218,8 @@ static CommandMap* createCommandMap()
         { "Copy", { hasRangeSelection, execCopy } },
         { "Cut", { hasEditableRangeSelection, execCut } },
         { "Delete", { hasEditableSelection, execDelete } },
+        { "DeleteWordBackward", { hasEditableSelection, execDeleteWordBackward } },
+        { "DeleteWordForward", { hasEditableSelection, execDeleteWordForward} },
         { "ForwardDelete", { hasEditableSelection, execForwardDelete } },
         { "InsertBacktab", { hasEditableSelection, execInsertBacktab } },
         { "InsertTab", { hasEditableSelection, execInsertTab } },
index cd206493ae4303a7839bbb7df1ec49b9cd6a0472..34504a264a9eaf5bcd158b480b2eaeb027a4a13b 100644 (file)
@@ -1,3 +1,14 @@
+2007-03-30  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Call execCommand for deleteWordForward and deleteWordBackward instead of calling
+        deleteWithDirection directly.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView deleteWordForward:]):
+        (-[WebHTMLView deleteWordBackward:]):
+
 2007-03-30  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Geoff.
index 987158acf100cedd9646d61278267aee5e591cfa..3305e7ca4c65f70adf65feb5701c25cf2d692dcb 100644 (file)
@@ -4417,14 +4417,14 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
 {
     Frame* coreFrame = core([self _frame]);
     if (coreFrame)
-        coreFrame->editor()->deleteWithDirection(SelectionController::FORWARD, WordGranularity, true, false);
+        coreFrame->editor()->execCommand("DeleteWordForward");
 }
 
 - (void)deleteWordBackward:(id)sender
 {
     Frame* coreFrame = core([self _frame]);
     if (coreFrame)
-        coreFrame->editor()->deleteWithDirection(SelectionController::BACKWARD, WordGranularity, true, false);
+        coreFrame->editor()->execCommand("DeleteWordBackward");
 }
 
 - (void)deleteToBeginningOfLine:(id)sender