2008-07-24 Tor Arne Vestbø <tavestbo@trolltech.com>
authorvestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jul 2008 12:04:36 +0000 (12:04 +0000)
committervestbo@webkit.org <vestbo@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jul 2008 12:04:36 +0000 (12:04 +0000)
        Reviewed by Simon

        Don't insert text on keyDown event in EditorClientQt.

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

WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/EditorClientQt.cpp

index 98ce2d3c646beb20571e38db904ac42f1bd89e42..8e5535606153951fe25781aa68b050beba8962f3 100644 (file)
@@ -1,3 +1,12 @@
+2008-07-24  Tor Arne Vestbø  <tavestbo@trolltech.com>
+
+        Reviewed by Simon
+
+        Don't insert text on keyDown event in EditorClientQt.
+
+        * WebCoreSupport/EditorClientQt.cpp:
+        (WebCore::EditorClientQt::handleKeyboardEvent):
+
 2008-07-04  Benjamin C Meyer  <ben@meyerhome.net>
 
         Reviewed by Simon.
 2008-07-04  Benjamin C Meyer  <ben@meyerhome.net>
 
         Reviewed by Simon.
index 9eee5a7d06921ea4d37e59a83f082a9d46a2fb61..c3d185ec745e42f4f0aaa1f9df0cb8c3b2a3b2ff 100644 (file)
@@ -382,7 +382,8 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
             case VK_TAB:
                 return;
             default:
             case VK_TAB:
                 return;
             default:
-                if (!kevent->ctrlKey() && !kevent->altKey() && !kevent->text().isEmpty()) {
+                if (kevent->type() != PlatformKeyboardEvent::KeyDown
+                        && !kevent->ctrlKey() && !kevent->altKey() && !kevent->text().isEmpty()) {
                     frame->editor()->insertText(kevent->text(), event);
                 } else if (kevent->ctrlKey()) {
                     switch (kevent->windowsVirtualKeyCode()) {
                     frame->editor()->insertText(kevent->text(), event);
                 } else if (kevent->ctrlKey()) {
                     switch (kevent->windowsVirtualKeyCode()) {
@@ -412,7 +413,7 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
                             break;
                         default:
                             // catch combination AltGr+key or Ctrl+Alt+key
                             break;
                         default:
                             // catch combination AltGr+key or Ctrl+Alt+key
-                            if (!kevent->text().isEmpty()) {
+                            if (kevent->type() != PlatformKeyboardEvent::KeyDown && !kevent->text().isEmpty()) {
                                 frame->editor()->insertText(kevent->text(), event);
                                 break;
                             }
                                 frame->editor()->insertText(kevent->text(), event);
                                 break;
                             }