[libreoffice/f18] Resolves: rhbz#895196 sc filter float a11y parent of itself

Caolán McNamara caolanm at fedoraproject.org
Tue Feb 19 16:48:44 UTC 2013


commit 028c5dc7f81196a41d30bab49d4e627400a8b1c6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 19 16:48:38 2013 +0000

    Resolves: rhbz#895196 sc filter float a11y parent of itself

 ...bz-895196-sc-filter-float-a11y-parent-of-.patch |   96 ++++++++++++++++++++
 libreoffice.spec                                   |    7 ++-
 2 files changed, 102 insertions(+), 1 deletions(-)
---
diff --git a/0001-Resolves-rhbz-895196-sc-filter-float-a11y-parent-of-.patch b/0001-Resolves-rhbz-895196-sc-filter-float-a11y-parent-of-.patch
new file mode 100644
index 0000000..0ca0894
--- /dev/null
+++ b/0001-Resolves-rhbz-895196-sc-filter-float-a11y-parent-of-.patch
@@ -0,0 +1,96 @@
+From 1b13c952f50aab2b907dab13395ab23d0955c238 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Fri, 15 Feb 2013 17:12:00 +0000
+Subject: [PATCH] Resolves: rhbz#895196 sc filter float a11y parent of itself
+ loop/recurse
+
+Change-Id: I3679e7cfcd32a78b40c6a7b803c92ff0abe6f32c
+---
+ accessibility/source/helper/acc_factory.cxx |  8 +++++---
+ vcl/inc/vcl/popupmenuwindow.hxx             |  3 +++
+ vcl/source/window/popupmenuwindow.cxx       |  6 ++++++
+ vcl/source/window/window.cxx                | 12 +++++++++---
+ 4 files changed, 23 insertions(+), 6 deletions(-)
+
+diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx
+index dc16fe6..93f6bf5 100644
+--- a/accessibility/source/helper/acc_factory.cxx
++++ b/accessibility/source/helper/acc_factory.cxx
+@@ -382,9 +382,11 @@ inline bool hasFloatingChild(Window *pWindow)
+             }
+             else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) )
+             {
+-                PopupMenuFloatingWindow* pChild = dynamic_cast<PopupMenuFloatingWindow*>(
+-                    pWindow->GetAccessibleChildWindow(0));
+-                if ( pChild && pChild->IsPopupMenu() )
++                // The logic here has to match that of Window::GetAccessibleParentWindow in
++                // vcl/source/window/window.cxx to avoid PopupMenuFloatingWindow
++                // becoming a11y parents of themselves
++                Window* pChild = pWindow->GetAccessibleChildWindow(0);
++                if (PopupMenuFloatingWindow::isPopupMenu(pChild))
+                 {
+                     // Get the accessible context from the child window.
+                     Reference<XAccessible> xAccessible = pChild->CreateAccessible();
+diff --git a/vcl/inc/vcl/popupmenuwindow.hxx b/vcl/inc/vcl/popupmenuwindow.hxx
+index 57b7747..a5856dc 100644
+--- a/vcl/inc/vcl/popupmenuwindow.hxx
++++ b/vcl/inc/vcl/popupmenuwindow.hxx
+@@ -34,6 +34,9 @@ public:
+     sal_uInt16      GetMenuStackLevel() const;
+     void            SetMenuStackLevel( sal_uInt16 nLevel );
+     bool            IsPopupMenu() const;
++
++    //determine if a given window is an activated PopupMenuFloatingWindow
++    static bool isPopupMenu(const Window *pWindow);
+ };
+ 
+ #endif
+diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx
+index e5e773a..7a03794 100644
+--- a/vcl/source/window/popupmenuwindow.cxx
++++ b/vcl/source/window/popupmenuwindow.cxx
+@@ -67,4 +67,10 @@ bool PopupMenuFloatingWindow::IsPopupMenu() const
+     return mpImplData->mnMenuStackLevel != ::std::numeric_limits<sal_uInt16>::max();
+ }
+ 
++bool PopupMenuFloatingWindow::isPopupMenu(const Window *pWindow)
++{
++    const PopupMenuFloatingWindow* pChild = dynamic_cast<const PopupMenuFloatingWindow*>(pWindow);
++    return pChild && pChild->IsPopupMenu();
++}
++
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
+index 6767fde..7ddb6b1 100644
+--- a/vcl/source/window/window.cxx
++++ b/vcl/source/window/window.cxx
+@@ -48,6 +48,7 @@
+ #include "vcl/unowrap.hxx"
+ #include "vcl/gdimtf.hxx"
+ #include "vcl/pdfextoutdevdata.hxx"
++#include "vcl/popupmenuwindow.hxx"
+ #include "vcl/lazydelete.hxx"
+ #include "vcl/virdev.hxx"
+ 
+@@ -8601,10 +8602,15 @@ Window* Window::GetAccessibleParentWindow() const
+             pWorkWin = pWorkWin->mpWindowImpl->mpNext;
+         pParent = pWorkWin;
+     }
+-    // If this a floating window which has a native boarder window, this one should be reported as
+-    // accessible parent
++    // If this is a floating window which has a native border window, then that border should be reported as
++    // the accessible parent, unless the floating window is a PopupMenuFloatingWindow
++    //
++    // The logic here has to match that of AccessibleFactory::createAccessibleContext in
++    // accessibility/source/helper/acc_factory.cxx to avoid PopupMenuFloatingWindow
++    // becoming a11y parents of themselves
+     else if( GetType() == WINDOW_FLOATINGWINDOW &&
+-        mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame)
++        mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame &&
++        !PopupMenuFloatingWindow::isPopupMenu(this))
+     {
+         pParent = mpWindowImpl->mpBorderWindow;
+     }
+-- 
+1.8.1.2
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 8681250..a3f4396 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -44,7 +44,7 @@ Summary:        Free Software Productivity Suite
 Name:           libreoffice
 Epoch:          1
 Version:        %{libo_version}.2
-Release:        4%{?libo_prerelease}%{?dist}
+Release:        5%{?libo_prerelease}%{?dist}
 License:        (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
 Group:          Applications/Productivity
 URL:            http://www.documentfoundation.org/develop
@@ -257,6 +257,7 @@ Patch35: 0001-valgrind-use-after-free.patch
 Patch36: 0001-make-evolution-3.6-work-with-address-book.patch
 Patch37: 0001-rhbz-908674-Adapt-rtl-Allocator-construct-to-C-11.patch
 Patch38: 0001-Resolves-rhbz-910176-cannot-select-directory-with-gn.patch
+Patch39: 0001-Resolves-rhbz-895196-sc-filter-float-a11y-parent-of-.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -1007,6 +1008,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch36 -p1 -b .make-evolution-3.6-work-with-address-book.patch
 %patch37 -p1 -b .rhbz-908674-Adapt-rtl-Allocator-construct-to-C-11.patch
 %patch38 -p1 -b .rhbz-910176-cannot-select-directory-with-gn.patch
+%patch39 -p1 -b .rhbz-895196-sc-filter-float-a11y-parent-of-.patch
 
 # TODO: check this
 # these are horribly incomplete--empty translations and copied english
@@ -2276,6 +2278,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %endif
 
 %changelog
+* Tue Feb 19 2013 Caolán McNamara <caolanm at redhat.com> - 1:3.6.5.2-5-UNBUILT
+- Resolves: rhbz#895196 sc filter float a11y parent of itself
+
 * Fri Feb 15 2013 Caolán McNamara <caolanm at redhat.com> - 1:3.6.5.2-4
 - make evolution 3.6 work with address book
 - Resolves: fdo#60491 missing libemboleobj.so


More information about the scm-commits mailing list