vcl/source/window/dlgctrl.cxx | 4 ++-- vcl/source/window/dlgctrl.hxx | 5 +++-- vcl/source/window/legacyaccessibility.cxx | 7 ++----- 3 files changed, 7 insertions(+), 9 deletions(-)
New commits: commit ae55831f16584aa2a727aa684df57f590bdab0e9 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Mon Nov 25 10:25:19 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Mon Nov 25 13:44:13 2024 +0100 a11y: Make param const to avoid const_cast in caller Make the `pWindow` param for `ImplFindDlgCtrlWindow` a const pointer, which removes the need to `const_cast` when calling the function in Window::getLegacyNonLayoutAccessibleRelationMemberOf. Change-Id: I2225f5c4be33060c1e3fddd5e83760e68856585d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177245 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index ac75333d9011..c5575ef6e5fc 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -324,8 +324,8 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType } /* namespace vcl */ -vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow, sal_uInt16& rIndex, - sal_uInt16& rFormStart, sal_uInt16& rFormEnd ) +vcl::Window* ImplFindDlgCtrlWindow(vcl::Window* pParent, const vcl::Window* pWindow, + sal_uInt16& rIndex, sal_uInt16& rFormStart, sal_uInt16& rFormEnd) { vcl::Window* pSWindow; vcl::Window* pSecondWindow = nullptr; diff --git a/vcl/source/window/dlgctrl.hxx b/vcl/source/window/dlgctrl.hxx index 94af911c7818..50d7ee1f2bab 100644 --- a/vcl/source/window/dlgctrl.hxx +++ b/vcl/source/window/dlgctrl.hxx @@ -23,8 +23,9 @@ vcl::Window* ImplGetChildWindow( vcl::Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, bool bTestEnable ); -vcl::Window* ImplFindDlgCtrlWindow( vcl::Window* pParent, vcl::Window* pWindow, sal_uInt16& rIndex, - sal_uInt16& rFormStart, sal_uInt16& rFormEnd ); +vcl::Window* ImplFindDlgCtrlWindow(vcl::Window* pParent, const vcl::Window* pWindow, + sal_uInt16& rIndex, sal_uInt16& rFormStart, + sal_uInt16& rFormEnd); vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_Unicode cCharCode, sal_uInt16 nFormStart, sal_uInt16 nFormEnd, bool bCheckEnable = true ); diff --git a/vcl/source/window/legacyaccessibility.cxx b/vcl/source/window/legacyaccessibility.cxx index a0f4aff33919..58410ed66d29 100644 --- a/vcl/source/window/legacyaccessibility.cxx +++ b/vcl/source/window/legacyaccessibility.cxx @@ -200,11 +200,8 @@ Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const // is directly before the control // get form start and form end and index of this control sal_uInt16 nIndex, nFormStart, nFormEnd; - Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow, - const_cast<Window*>(this), - nIndex, - nFormStart, - nFormEnd ); + Window* pSWindow + = ::ImplFindDlgCtrlWindow(pFrameWindow, this, nIndex, nFormStart, nFormEnd); if( pSWindow && nIndex != nFormStart ) { if( GetType() == WindowType::PUSHBUTTON ||