Changeset 86273 in webkit
- Timestamp:
- May 11, 2011 2:35:49 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86272 r86273 1 2011-05-11 Daniel Bates <dbates@rim.com> 2 3 Reviewed by Antonio Gomes. 4 5 [Qt] Extract code to set mouse event modifiers into common function 6 https://bugs.webkit.org/show_bug.cgi?id=60649 7 8 Consolidate code to set the keyboard modifiers for a mouse event into a common 9 function that can be used by both PlatformMouseEvent(QGraphicsSceneMouseEvent*, int clickCount) 10 and PlatformMouseEvent(QInputEvent*, int clickCount) so as to remove duplicate code. 11 12 No functionality was changed. So, no new tests. 13 14 * platform/qt/PlatformMouseEventQt.cpp: 15 (WebCore::mouseEventModifiersFromQtKeyboardModifiers): Added. 16 (WebCore::PlatformMouseEvent::PlatformMouseEvent): Modified to call mouseEventModifiersFromQtKeyboardModifiers(). 17 1 18 2011-05-11 Levi Weintraub <leviw@chromium.org> 2 19 -
trunk/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp
r75870 r86273 35 35 namespace WebCore { 36 36 37 static void mouseEventModifiersFromQtKeyboardModifiers(Qt::KeyboardModifiers keyboardModifiers, bool& altKey, bool& ctrlKey, bool& metaKey, bool& shiftKey) 38 { 39 altKey = keyboardModifiers & Qt::AltModifier; 40 ctrlKey = keyboardModifiers & Qt::ControlModifier; 41 metaKey = keyboardModifiers & Qt::MetaModifier; 42 shiftKey = keyboardModifiers & Qt::ShiftModifier; 43 } 44 37 45 #if !defined(QT_NO_GRAPHICSVIEW) 38 46 PlatformMouseEvent::PlatformMouseEvent(QGraphicsSceneMouseEvent* event, int clickCount) … … 66 74 67 75 m_clickCount = clickCount; 68 m_shiftKey = (event->modifiers() & Qt::ShiftModifier); 69 m_ctrlKey = (event->modifiers() & Qt::ControlModifier); 70 m_altKey = (event->modifiers() & Qt::AltModifier); 71 m_metaKey = (event->modifiers() & Qt::MetaModifier); 76 mouseEventModifiersFromQtKeyboardModifiers(event->modifiers(), m_altKey, m_ctrlKey, m_metaKey, m_shiftKey); 72 77 } 73 78 #endif // QT_NO_GRAPHICSVIEW … … 122 127 123 128 m_clickCount = clickCount; 124 m_shiftKey = (event->modifiers() & Qt::ShiftModifier); 125 m_ctrlKey = (event->modifiers() & Qt::ControlModifier); 126 m_altKey = (event->modifiers() & Qt::AltModifier); 127 m_metaKey = (event->modifiers() & Qt::MetaModifier); 129 mouseEventModifiersFromQtKeyboardModifiers(event->modifiers(), m_altKey, m_ctrlKey, m_metaKey, m_shiftKey); 128 130 } 129 131
Note: See TracChangeset
for help on using the changeset viewer.