diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-08-23 17:02:04 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-08-23 22:21:51 +0200 |
commit | 16cf257554887aeb6dc426c54ceeb8d70a6aadd0 (patch) | |
tree | 0a3b5112651dad3c9f984374ba5d1b728d281a4a /accessibility/source/extended/AccessibleBrowseBox.cxx | |
parent | 9ba4b01ba57d059a04038823a1f0cf3bb2cb383c (diff) |
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.weghorn@posteo.de>
Diffstat (limited to 'accessibility/source/extended/AccessibleBrowseBox.cxx')
-rw-r--r-- | accessibility/source/extended/AccessibleBrowseBox.cxx | 25 |
1 files changed, 10 insertions, 15 deletions
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 > |