[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:11:12 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 2c7baff69fc8bffcf0451cf2b97cde7d56eaf30e
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 12 17:32:54 2003 +0000

            Reviewed by Richard
    
    	Fix for this bug:
    
    	<rdar://problem/3481600>: key event objects do not preserve unmodified keys
    
            * khtml/xml/dom2_eventsimpl.cpp: Modified constructor call to include
    	unmodifiedText.
            (KeyboardEventImpl::KeyboardEventImpl):
            * kwq/KWQEvent.h: Added unmodifiedText accessor and variable to QKeyEvent.
            * kwq/KWQEvent.mm:
            (QKeyEvent::QKeyEvent): Modified constructor to include unmodifiedText.
            (QKeyEvent::unmodifiedText): Added accessor.
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::keyEvent): Modified constructor call to include
            unmodifiedText.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5465 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 6ef533b..63312b8 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,24 @@
 2003-11-12  Ken Kocienda  <kocienda at apple.com>
 
+        Reviewed by Richard
+
+	Fix for this bug:
+
+	<rdar://problem/3481600>: key event objects do not preserve unmodified keys
+
+        * khtml/xml/dom2_eventsimpl.cpp: Modified constructor call to include
+	unmodifiedText.
+        (KeyboardEventImpl::KeyboardEventImpl):
+        * kwq/KWQEvent.h: Added unmodifiedText accessor and variable to QKeyEvent.
+        * kwq/KWQEvent.mm:
+        (QKeyEvent::QKeyEvent): Modified constructor to include unmodifiedText.
+        (QKeyEvent::unmodifiedText): Added accessor.
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::keyEvent): Modified constructor call to include
+        unmodifiedText.
+
+2003-11-12  Ken Kocienda  <kocienda at apple.com>
+
         Reviewed by Maciej
 
         * khtml/html/html_elementimpl.cpp:
diff --git a/WebCore/khtml/xml/dom2_eventsimpl.cpp b/WebCore/khtml/xml/dom2_eventsimpl.cpp
index 2f2cf6a..e346856 100644
--- a/WebCore/khtml/xml/dom2_eventsimpl.cpp
+++ b/WebCore/khtml/xml/dom2_eventsimpl.cpp
@@ -525,7 +525,7 @@ KeyboardEventImpl::KeyboardEventImpl(QKeyEvent *key, AbstractViewImpl *view)
   : UIEventImpl(key->type() == QEvent::KeyRelease ? KEYUP_EVENT : key->isAutoRepeat() ? KHTML_KEYPRESS_EVENT : KEYDOWN_EVENT,
                 true,true,view,0)
 {
-    m_keyEvent = new QKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->isAutoRepeat(), key->count());
+    m_keyEvent = new QKeyEvent(key->type(), key->key(), key->ascii(), key->state(), key->text(), key->unmodifiedText(), key->isAutoRepeat(), key->count());
     // Events are supposed to be accepted by default in Qt!
     // This line made QLineEdit's keyevents be ignored, so they were sent to the khtmlview
     // (and e.g. space would make it scroll down)
diff --git a/WebCore/kwq/KWQEvent.h b/WebCore/kwq/KWQEvent.h
index 962b35a..501daa6 100644
--- a/WebCore/kwq/KWQEvent.h
+++ b/WebCore/kwq/KWQEvent.h
@@ -99,7 +99,7 @@ private:
 
 class QKeyEvent : public QEvent {
 public:
-    QKeyEvent(Type type, int key, int ascii, int buttonState, const QString &textVal = QString::null, bool autoRepeat = FALSE, ushort countVal = 1);
+    QKeyEvent(Type type, int key, int ascii, int buttonState, const QString &text = QString::null, const QString &unmodifiedText = QString::null, bool autoRepeat = FALSE, ushort countVal = 1);
 
     int key() const;
     ButtonState state() const;
@@ -109,6 +109,7 @@ public:
     bool isAccepted() const;
     int count()  const;
     QString text() const;
+    QString unmodifiedText() const;
     int ascii() const;
     QString identifier() const;
  private:
@@ -116,6 +117,7 @@ public:
     int _ascii;
     ButtonState _state;
     QString _text;
+    QString _unmodifiedText;
     QString _identifier;
     bool _autoRepeat;
     int _count;
diff --git a/WebCore/kwq/KWQEvent.mm b/WebCore/kwq/KWQEvent.mm
index 3267fe2..125f4cf 100644
--- a/WebCore/kwq/KWQEvent.mm
+++ b/WebCore/kwq/KWQEvent.mm
@@ -334,17 +334,18 @@ static QString identifierForKeyText(const QString &text)
     }
 }
 
-QKeyEvent::QKeyEvent(Type t, int key, int ascii, int buttonState, const QString &text, bool autoRepeat, ushort count)
+QKeyEvent::QKeyEvent(Type t, int key, int ascii, int buttonState, const QString &text, const QString &unmodifiedText, bool autoRepeat, ushort count)
     : QEvent(t),
       _key(key),
       _ascii(ascii),
       _state((ButtonState)buttonState),
       _text(text),
+      _unmodifiedText(unmodifiedText),
       _autoRepeat(autoRepeat),
       _count(count),
       _isAccepted(false)
 {
-    _identifier = identifierForKeyText(text);
+    _identifier = identifierForKeyText(unmodifiedText);
 }
 
 int QKeyEvent::key() const
@@ -377,6 +378,11 @@ QString QKeyEvent::text(void) const
     return _text;
 }
 
+QString QKeyEvent::unmodifiedText(void) const
+{
+    return _unmodifiedText;
+}
+
 int QKeyEvent::ascii(void) const
 {
     return _ascii;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 11bdf4b..939b24f 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -1470,6 +1470,7 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 		     ascii,
 		     stateForCurrentEvent(),
 		     QString::fromNSString([event characters]),
+                     QString::fromNSString([event charactersIgnoringModifiers]),
 		     [event isARepeat]);
     bool result = !node->dispatchKeyEvent(&qEvent);
 
@@ -1480,7 +1481,8 @@ bool KWQKHTMLPart::keyEvent(NSEvent *event)
 			 [event keyCode],
 			 ascii,
 			 stateForCurrentEvent(),
-			 QString::fromNSString([event characters]),
+                         QString::fromNSString([event characters]),
+                         QString::fromNSString([event charactersIgnoringModifiers]),
 			 true);
         if (!node->dispatchKeyEvent(&qEvent)) {
 	    result = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list