accessibility/inc/extended/AccessibleBrowseBoxBase.hxx | 6 ++-- accessibility/source/extended/AccessibleBrowseBox.cxx | 25 ++++++----------- 2 files changed, 13 insertions(+), 18 deletions(-)
New commits: commit 16cf257554887aeb6dc426c54ceeb8d70a6aadd0 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 23 17:02:04 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Aug 23 22:21:51 2023 +0200 a11y: Simplify AccessibleBrowseBox::implGetHeaderBar Use the `mxColumnHeaderBar` and `mxRowHeaderBar` members directly instead of a pointer to an `rtl::Reference` that can be either of them. Change-Id: I620c7ba92a14fad50d9371b1762b5d5ad05fd7ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156011 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx index e8276958f0f1..056d2c1b5f1c 100644 --- a/accessibility/source/extended/AccessibleBrowseBox.cxx +++ b/accessibility/source/extended/AccessibleBrowseBox.cxx @@ -204,25 +204,20 @@ css::uno::Reference< css::accessibility::XAccessible > AccessibleBrowseBox::impl css::uno::Reference< css::accessibility::XAccessible > AccessibleBrowseBox::implGetHeaderBar(AccessibleBrowseBoxObjType eObjType) { - css::uno::Reference< css::accessibility::XAccessible > xRet; - rtl::Reference< AccessibleBrowseBoxHeaderBar >* pxMember = nullptr; - if( eObjType == AccessibleBrowseBoxObjType::RowHeaderBar ) - pxMember = &mxRowHeaderBar; + { + if (!mxRowHeaderBar.is()) + mxRowHeaderBar = new AccessibleBrowseBoxHeaderBar(m_aCreator, *mpBrowseBox, eObjType); + return mxRowHeaderBar; + } else if( eObjType == AccessibleBrowseBoxObjType::ColumnHeaderBar ) - pxMember = &mxColumnHeaderBar; - - if( pxMember ) { - if( !pxMember->is() ) - { - rtl::Reference<AccessibleBrowseBoxHeaderBar> pHeaderBar = new AccessibleBrowseBoxHeaderBar( - m_aCreator, *mpBrowseBox, eObjType ); - *pxMember = pHeaderBar; - } - xRet = pxMember->get(); + if (!mxColumnHeaderBar.is()) + mxColumnHeaderBar = new AccessibleBrowseBoxHeaderBar(m_aCreator, *mpBrowseBox, eObjType); + return mxColumnHeaderBar; } - return xRet; + + return css::uno::Reference<css::accessibility::XAccessible>(); } css::uno::Reference< css::accessibility::XAccessible > commit 9ba4b01ba57d059a04038823a1f0cf3bb2cb383c Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Wed Aug 23 16:40:53 2023 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Aug 23 22:21:41 2023 +0200 a11y: Make AccessibleBrowseBoxBase's client ID private The getter and setter are only used by the class itself, not by any derived classes, and the client ID is an implementation detail, so make the methods private instead of protected. Change-Id: I380aa9848ae515b7b4ae1a727b3c5720b53250fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156010 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx index ef199ee2da5c..d4ea1aabc07f 100644 --- a/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx +++ b/accessibility/inc/extended/AccessibleBrowseBoxBase.hxx @@ -270,9 +270,6 @@ protected: */ AbsoluteScreenPixelRectangle getBoundingBoxOnScreen(); - ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } - void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } - public: /** @return The osl::Mutex member provided by the class BaseMutex. */ ::osl::Mutex& getMutex( ) { return m_aMutex; } @@ -294,6 +291,9 @@ protected: css::uno::Reference< css::awt::XWindow > m_xFocusWindow; private: + ::comphelper::AccessibleEventNotifier::TClientId getClientId() const { return m_aClientId; } + void setClientId(::comphelper::AccessibleEventNotifier::TClientId _aNewClientId) { m_aClientId = _aNewClientId; } + /** Localized name. */ OUString maName; /** Localized description text. */