[Libreoffice-commits] core.git: vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 28 06:52:49 UTC 2018
vcl/source/window/accessibility.cxx | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
New commits:
commit 8dc8b22997138ff51b2e1b806a2a42f3b363d58f
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Thu Sep 27 12:28:16 2018 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Fri Sep 28 08:52:21 2018 +0200
Guard against invalid states
Happened while trying the qt5 a11y stuff that mpWindowImpl was invalid.
Change-Id: Ibe238bdcce6410689b1e65f7f45f7b9deea06de7
Reviewed-on: https://gerrit.libreoffice.org/61032
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx
index 7500f0507a34..947ddd87a7bd 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -170,7 +170,7 @@ bool Window::ImplIsAccessibleNativeFrame() const
vcl::Window* Window::GetAccessibleParentWindow() const
{
- if ( ImplIsAccessibleNativeFrame() )
+ if (!mpWindowImpl || ImplIsAccessibleNativeFrame())
return nullptr;
vcl::Window* pParent = mpWindowImpl->mpParent;
@@ -203,6 +203,9 @@ vcl::Window* Window::GetAccessibleParentWindow() const
sal_uInt16 Window::GetAccessibleChildWindowCount()
{
+ if (!mpWindowImpl)
+ return 0;
+
sal_uInt16 nChildren = 0;
vcl::Window* pChild = mpWindowImpl->mpFirstChild;
while( pChild )
@@ -407,6 +410,9 @@ sal_uInt16 Window::getDefaultAccessibleRole() const
sal_uInt16 Window::GetAccessibleRole() const
{
+ if (!mpWindowImpl)
+ return 0;
+
sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF;
if ( nRole == 0xFFFF )
nRole = getDefaultAccessibleRole();
@@ -427,6 +433,9 @@ void Window::SetAccessibleName( const OUString& rName )
OUString Window::GetAccessibleName() const
{
+ if (!mpWindowImpl)
+ return OUString();
+
if (mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleName)
return *mpWindowImpl->mpAccessibleInfos->pAccessibleName;
return getDefaultAccessibleName();
@@ -506,6 +515,9 @@ void Window::SetAccessibleDescription( const OUString& rDescription )
OUString Window::GetAccessibleDescription() const
{
+ if (!mpWindowImpl)
+ return OUString();
+
OUString aAccessibleDescription;
if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleDescription )
{
More information about the Libreoffice-commits
mailing list