Title: [88723] trunk/Source/WebKit/efl
Revision
88723
Author
[email protected]
Date
2011-06-13 15:45:23 -0700 (Mon, 13 Jun 2011)

Log Message

2011-06-13  Jaehun Lim  <[email protected]>

        Reviewed by Eric Seidel.

        [EFL] Supports to execute "redo" command.
        https://bugs.webkit.org/show_bug.cgi?id=62536

        Implements basic functions for "redo" command.

        * WebCoreSupport/EditorClientEfl.cpp:
        (WebCore::EditorClientEfl::registerCommandForUndo):
        (WebCore::EditorClientEfl::registerCommandForRedo):
        (WebCore::EditorClientEfl::clearUndoRedoOperations):
        (WebCore::EditorClientEfl::canRedo):
        (WebCore::EditorClientEfl::redo):
        * WebCoreSupport/EditorClientEfl.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/efl/ChangeLog (88722 => 88723)


--- trunk/Source/WebKit/efl/ChangeLog	2011-06-13 22:44:59 UTC (rev 88722)
+++ trunk/Source/WebKit/efl/ChangeLog	2011-06-13 22:45:23 UTC (rev 88723)
@@ -1,3 +1,20 @@
+2011-06-13  Jaehun Lim  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        [EFL] Supports to execute "redo" command.
+        https://bugs.webkit.org/show_bug.cgi?id=62536
+
+        Implements basic functions for "redo" command.
+
+        * WebCoreSupport/EditorClientEfl.cpp:
+        (WebCore::EditorClientEfl::registerCommandForUndo):
+        (WebCore::EditorClientEfl::registerCommandForRedo):
+        (WebCore::EditorClientEfl::clearUndoRedoOperations):
+        (WebCore::EditorClientEfl::canRedo):
+        (WebCore::EditorClientEfl::redo):
+        * WebCoreSupport/EditorClientEfl.h:
+
 2011-06-13  Grzegorz Czajkowski  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp (88722 => 88723)


--- trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp	2011-06-13 22:44:59 UTC (rev 88722)
+++ trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp	2011-06-13 22:45:23 UTC (rev 88723)
@@ -147,17 +147,19 @@
 
 void EditorClientEfl::registerCommandForUndo(WTF::PassRefPtr<EditCommand> command)
 {
+    redoStack.clear();
     undoStack.append(command);
 }
 
-void EditorClientEfl::registerCommandForRedo(WTF::PassRefPtr<EditCommand>)
+void EditorClientEfl::registerCommandForRedo(WTF::PassRefPtr<EditCommand> command)
 {
-    notImplemented();
+    redoStack.append(command);
 }
 
 void EditorClientEfl::clearUndoRedoOperations()
 {
     undoStack.clear();
+    redoStack.clear();
 }
 
 bool EditorClientEfl::canCopyCut(Frame*, bool defaultValue) const
@@ -177,8 +179,7 @@
 
 bool EditorClientEfl::canRedo() const
 {
-    notImplemented();
-    return false;
+    return !redoStack.isEmpty();
 }
 
 void EditorClientEfl::undo()
@@ -190,7 +191,9 @@
 
 void EditorClientEfl::redo()
 {
-    notImplemented();
+    RefPtr<WebCore::EditCommand> command(*(--redoStack.end()));
+    redoStack.remove(--redoStack.end());
+    command->reapply();
 }
 
 bool EditorClientEfl::shouldInsertNode(Node*, Range*, EditorInsertAction)

Modified: trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h (88722 => 88723)


--- trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h	2011-06-13 22:44:59 UTC (rev 88722)
+++ trunk/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h	2011-06-13 22:45:23 UTC (rev 88723)
@@ -47,6 +47,7 @@
 class EditorClientEfl : public EditorClient, public TextCheckerClient {
 protected:
     WTF::Deque<WTF::RefPtr<WebCore::EditCommand> > undoStack;
+    WTF::Deque<WTF::RefPtr<WebCore::EditCommand> > redoStack;
 
 public:
     EditorClientEfl(Evas_Object *view);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to