diff options
-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 > |