sc/source/ui/view/gridwin5.cxx | 5 ++--- sc/source/ui/view/preview.cxx | 12 ++---------- sd/source/ui/slideshow/showwin.cxx | 12 ++++-------- 3 files changed, 8 insertions(+), 21 deletions(-)
New commits: commit f84f7188bd55f38199b26f22bc76dcb247955b27 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jun 25 11:21:36 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jun 26 13:10:52 2025 +0200 sd a11y: Simplify ShowWindow::CreateAccessible As a vcl::Window::CreateAccessible override, it only gets called from vcl::Window::GetAccessible when no accessible has been set yet, so there's no need to check that inside of the method implementation again. Change-Id: I14300e01cfc7b72670e99add57a4adb44d7f6084 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186963 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index f0dcd4857a17..004686a937e2 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -617,16 +617,12 @@ void ShowWindow::AddWindowToPaintView() css::uno::Reference<css::accessibility::XAccessible> ShowWindow::CreateAccessible() { - css::uno::Reference< css::accessibility::XAccessible > xAcc = GetAccessible(false); - if (xAcc) - { - return xAcc; - } if (mpViewShell != nullptr) { - xAcc = mpViewShell->CreateAccessibleDocumentView (this); - SetAccessible(xAcc); - return xAcc; + rtl::Reference<comphelper::OAccessible> pAcc + = mpViewShell->CreateAccessibleDocumentView(this); + SetAccessible(pAcc); + return pAcc; } else { commit bb2034c17401c418b55bfd2c0a2716155cd1a9b8 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jun 25 11:17:37 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jun 26 13:10:43 2025 +0200 sc a11y: Drop unnecessary XAccessible var Change-Id: I07ae0a836b0930557897f93017da680861b5d51f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186962 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index 40edc0844e75..3913b2c27e84 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -379,12 +379,11 @@ css::uno::Reference< css::accessibility::XAccessible > mrViewData.GetViewShell(), eWhich); pAccessibleDocument->PreInit(); - css::uno::Reference<css::accessibility::XAccessible> xAcc = pAccessibleDocument; - SetAccessible(xAcc); + SetAccessible(pAccessibleDocument); pAccessibleDocument->Init(); - return xAcc; + return pAccessibleDocument; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ef66c90956ea0e0b9fbf7fa522e0a8befdc8b36d Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jun 25 11:13:36 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jun 26 13:10:37 2025 +0200 sc a11y: Simplify ScPreview::CreateAccessible As a vcl::Window::CreateAccessible override, it only gets called from vcl::Window::GetAccessible when no accessible has been set yet, so there's no need to check that inside of the method implementation again. Also drop the local var `xAcc` altogether as assigning to it in the remaining code path instead of using `pAccessible` directy was unnecessary anyway. Change-Id: I9db83bc9263175a6903ce163bc4b9ded2e0f7f98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186961 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 4b351c34a6f6..3340d75b9ebf 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -1517,19 +1517,11 @@ void ScPreview::LoseFocus() css::uno::Reference<css::accessibility::XAccessible> ScPreview::CreateAccessible() { - css::uno::Reference<css::accessibility::XAccessible> xAcc= GetAccessible(false); - if (xAcc.is()) - { - return xAcc; - } - rtl::Reference<ScAccessibleDocumentPagePreview> pAccessible = new ScAccessibleDocumentPagePreview(GetAccessibleParent(), pViewShell ); - - xAcc = pAccessible; - SetAccessible(xAcc); + SetAccessible(pAccessible); pAccessible->Init(); - return xAcc; + return pAccessible; } void ScPreview::DragMove( tools::Long nDragMovePos, PointerStyle nFlags )
