accessibility/source/standard/accessiblemenubasecomponent.cxx |   14 +++-------
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 8e551d8321ad2b2ea6eb6d64b9390633be3f313e
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Oct 15 10:54:55 2024 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Oct 15 13:01:08 2024 +0200

    a11y: Drop intermediate local variable
    
    Assign to `xChild` right away and drop
    the extra local variable `pChild`.
    
    Change-Id: I2ac02b12a5e833821f51f35c74269aa67a628122
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174963
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx 
b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index dc268b5caad6..66d90a0d7087 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -302,30 +302,26 @@ Reference< XAccessible > 
OAccessibleMenuBaseComponent::GetChild( sal_Int64 i )
         if ( m_pMenu )
         {
             // create a new child
-            rtl::Reference<OAccessibleMenuItemComponent> pChild;
-
             if ( m_pMenu->GetItemType( static_cast<sal_uInt16>(i) ) == 
MenuItemType::SEPARATOR )
             {
-                pChild = new VCLXAccessibleMenuSeparator( m_pMenu, 
static_cast<sal_uInt16>(i) );
+                xChild = new VCLXAccessibleMenuSeparator(m_pMenu, 
static_cast<sal_uInt16>(i));
             }
             else
             {
                 PopupMenu* pPopupMenu = m_pMenu->GetPopupMenu( 
m_pMenu->GetItemId( static_cast<sal_uInt16>(i) ) );
                 if ( pPopupMenu )
                 {
-                    pChild = new VCLXAccessibleMenu( m_pMenu, 
static_cast<sal_uInt16>(i), pPopupMenu );
-                    pPopupMenu->SetAccessible( pChild );
+                    xChild = new VCLXAccessibleMenu(m_pMenu, 
static_cast<sal_uInt16>(i), pPopupMenu);
+                    pPopupMenu->SetAccessible(xChild);
                 }
                 else
                 {
-                    pChild = new VCLXAccessibleMenuItem( m_pMenu, 
static_cast<sal_uInt16>(i) );
+                    xChild = new VCLXAccessibleMenuItem(m_pMenu, 
static_cast<sal_uInt16>(i));
                 }
             }
 
             // set states
-            pChild->SetStates();
-
-            xChild = std::move(pChild);
+            xChild->SetStates();
 
             // insert into menu item list
             m_aAccessibleChildren[i] = xChild;

Reply via email to