Remove all references to QAccessible::Self
authorJan-Arve Saether <jan-arve.saether@nokia.com>
Wed, 18 Jan 2012 13:42:13 +0000 (14:42 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 19 Jan 2012 07:05:05 +0000 (08:05 +0100)
navigate() to Self does not make any sense (its basically a clone).
It seems that its not that useful to return Self from relationTo(),
since it was only one place where relationTo() was called where it
checked for the Self flag. This was in the windows bridge, and we
could easily work around that.
If it really turns out that Self is useful, we can always add that
enum value back later.

Change-Id: I9ebb60da059a843de5e6fcab9e815b919afc6f2a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
src/gui/accessible/qaccessible.h
src/gui/accessible/qaccessibleobject.cpp
src/plugins/platforms/windows/qwindowsaccessibility.cpp
src/widgets/accessible/qaccessiblewidget.cpp

index 8903628..2e50291 100644 (file)
@@ -306,7 +306,6 @@ public:
 
     enum RelationFlag {
         Unrelated     = 0x00000000,
-        Self          = 0x00000001,
         FocusChild    = 0x00010000,
         Label         = 0x00020000,
         Labelled      = 0x00040000,
index c9b01c7..313bff3 100644 (file)
@@ -231,10 +231,6 @@ QAccessible::Relation QAccessibleApplication::relationTo(const QAccessibleInterf
     if (!o)
         return QAccessible::Unrelated;
 
-    if(o == object()) {
-        return QAccessible::Self;
-    }
-
     return QAccessible::Unrelated;
 }
 
index fdf6c91..4cc08c7 100644 (file)
@@ -694,7 +694,7 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v
     case NAVDIR_LEFT:
     case NAVDIR_RIGHT:
         if (QAccessibleInterface *pIface = accessible->parent()) {
-
+            const int indexOfOurself = pIface->indexOfChild(accessible);
             QRect startg = accessible->rect();
             QPoint startc = startg.center();
             QAccessibleInterface *candidate = 0;
@@ -704,7 +704,7 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT v
                 QAccessibleInterface *sibling = 0;
                 sibling = pIface->child(i);
                 Q_ASSERT(sibling);
-                if ((accessible->relationTo(sibling) & QAccessible::Self) || sibling->state().invisible) {
+                if (i == indexOfOurself || sibling->state().invisible) {
                     //ignore ourself and invisible siblings
                     delete sibling;
                     continue;
index f4b73b5..67b9f17 100644 (file)
@@ -361,9 +361,6 @@ QAccessible::Relation QAccessibleWidget::relationTo(const QAccessibleInterface *
     if (inverse & QAccessible::Label)
         relation |= QAccessible::Labelled;
 
-    if(o == object())
-        relation |= QAccessible::Self;
-
     return relation;
 }