Changeset 86273 in webkit


Ignore:
Timestamp:
May 11, 2011 2:35:49 PM (13 years ago)
Author:
dbates@webkit.org
Message:

2011-05-11 Daniel Bates <dbates@rim.com>

Reviewed by Antonio Gomes.

[Qt] Extract code to set mouse event modifiers into common function
https://bugs.webkit.org/show_bug.cgi?id=60649

Consolidate code to set the keyboard modifiers for a mouse event into a common
function that can be used by both PlatformMouseEvent(QGraphicsSceneMouseEvent*, int clickCount)
and PlatformMouseEvent(QInputEvent*, int clickCount) so as to remove duplicate code.

No functionality was changed. So, no new tests.

  • platform/qt/PlatformMouseEventQt.cpp: (WebCore::mouseEventModifiersFromQtKeyboardModifiers): Added. (WebCore::PlatformMouseEvent::PlatformMouseEvent): Modified to call mouseEventModifiersFromQtKeyboardModifiers().
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86272 r86273  
     12011-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
    1182011-05-11  Levi Weintraub  <leviw@chromium.org>
    219
  • trunk/Source/WebCore/platform/qt/PlatformMouseEventQt.cpp

    r75870 r86273  
    3535namespace WebCore {
    3636
     37static 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
    3745#if !defined(QT_NO_GRAPHICSVIEW)
    3846PlatformMouseEvent::PlatformMouseEvent(QGraphicsSceneMouseEvent* event, int clickCount)
     
    6674
    6775    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);
    7277}
    7378#endif // QT_NO_GRAPHICSVIEW
     
    122127
    123128    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);
    128130}
    129131
Note: See TracChangeset for help on using the changeset viewer.