sw/source/core/access/accmap.cxx |   27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

New commits:
commit 3b6eeb46a59d3c7311ca0f57f3d8c91207bbfcdd
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 17 09:48:55 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 18 08:27:02 2025 +0200

    sw a11y: Drop unused typedefs
    
    Change-Id: I71fd3c2f48f753c7f1b3afa6c9ee50c7f04ee463
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184325
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Reviewed-by: Simon Chenery <simon_chen...@yahoo.com>

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index ad64ae37e76e..186b789ea5ba 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -88,7 +88,6 @@ class SwAccessibleContextMap_Impl
 public:
     typedef const SwFrame *                                             
key_type;
     typedef unotools::WeakReference < SwAccessibleContext >                  
mapped_type;
-    typedef std::pair<const key_type,mapped_type>                       
value_type;
     typedef std::unordered_map<key_type, mapped_type>::iterator iterator;
     typedef std::unordered_map<key_type, mapped_type>::const_iterator 
const_iterator;
 private:
@@ -259,7 +258,6 @@ public:
 
     typedef const SdrObject *                                           
key_type;
     typedef unotools::WeakReference<::accessibility::AccessibleShape>   
mapped_type;
-    typedef std::pair<const key_type,mapped_type>                       
value_type;
     typedef std::map<key_type, mapped_type>::iterator iterator;
     typedef std::map<key_type, mapped_type>::const_iterator const_iterator;
 
@@ -652,7 +650,6 @@ class SwAccessibleSelectedParas_Impl
 public:
     typedef unotools::WeakReference < SwAccessibleContext >             
key_type;
     typedef SwAccessibleParaSelection                                   
mapped_type;
-    typedef std::pair<const key_type,mapped_type>                       
value_type;
     typedef SwXAccWeakRefComp                                           
key_compare;
     typedef std::map<key_type,mapped_type,key_compare>::iterator        
iterator;
     typedef std::map<key_type,mapped_type,key_compare>::const_iterator  
const_iterator;
commit 0032418589fd04ed61f3c0653a7c563c3a0e0123
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 17 09:45:11 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 18 08:26:48 2025 +0200

    sw a11y: Drop assignment to intermediate local var
    
    Just assign to `xAcc` right away and drop `pAcc`.
    
    Change-Id: Iabe5169f971e756b573af294100232955ded135e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184324
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 6dda66935951..ad64ae37e76e 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1751,19 +1751,18 @@ rtl::Reference<SwAccessibleContext> 
SwAccessibleMap::GetContextImpl(const SwFram
 
         if( !xAcc.is() && bCreate )
         {
-            rtl::Reference<SwAccessibleContext> pAcc;
             switch( pFrame->GetType() )
             {
             case SwFrameType::Txt:
-                pAcc = new SwAccessibleParagraph(shared_from_this(),
+                xAcc = new SwAccessibleParagraph(shared_from_this(),
                                 static_cast< const SwTextFrame& >( *pFrame ) );
                 break;
             case SwFrameType::Header:
-                pAcc = new SwAccessibleHeaderFooter(shared_from_this(),
+                xAcc = new SwAccessibleHeaderFooter(shared_from_this(),
                                 static_cast< const SwHeaderFrame *>( pFrame ) 
);
                 break;
             case SwFrameType::Footer:
-                pAcc = new SwAccessibleHeaderFooter(shared_from_this(),
+                xAcc = new SwAccessibleHeaderFooter(shared_from_this(),
                                 static_cast< const SwFooterFrame *>( pFrame ) 
);
                 break;
             case SwFrameType::Ftn:
@@ -1772,7 +1771,7 @@ rtl::Reference<SwAccessibleContext> 
SwAccessibleMap::GetContextImpl(const SwFram
                         static_cast < const SwFootnoteFrame * >( pFrame );
                     bool bIsEndnote =
                         SwAccessibleFootnote::IsEndnote( pFootnoteFrame );
-                    pAcc = new SwAccessibleFootnote(shared_from_this(), 
bIsEndnote,
+                    xAcc = new SwAccessibleFootnote(shared_from_this(), 
bIsEndnote,
                                 /*(bIsEndnote ? mnEndnote++ : mnFootnote++),*/
                                 pFootnoteFrame );
                 }
@@ -1784,33 +1783,32 @@ rtl::Reference<SwAccessibleContext> 
SwAccessibleMap::GetContextImpl(const SwFram
                     switch( SwAccessibleFrameBase::GetNodeType( pFlyFrame ) )
                     {
                     case SwNodeType::Grf:
-                        pAcc = new SwAccessibleGraphic(shared_from_this(), 
pFlyFrame );
+                        xAcc = new SwAccessibleGraphic(shared_from_this(), 
pFlyFrame );
                         break;
                     case SwNodeType::Ole:
-                        pAcc = new 
SwAccessibleEmbeddedObject(shared_from_this(), pFlyFrame );
+                        xAcc = new 
SwAccessibleEmbeddedObject(shared_from_this(), pFlyFrame );
                         break;
                     default:
-                        pAcc = new SwAccessibleTextFrame(shared_from_this(), 
*pFlyFrame );
+                        xAcc = new SwAccessibleTextFrame(shared_from_this(), 
*pFlyFrame );
                         break;
                     }
                 }
                 break;
             case SwFrameType::Cell:
-                pAcc = new SwAccessibleCell(shared_from_this(),
+                xAcc = new SwAccessibleCell(shared_from_this(),
                                 static_cast< const SwCellFrame *>( pFrame ) );
                 break;
             case SwFrameType::Tab:
-                pAcc = new SwAccessibleTable(shared_from_this(),
+                xAcc = new SwAccessibleTable(shared_from_this(),
                                 static_cast< const SwTabFrame *>( pFrame ) );
                 break;
             case SwFrameType::Page:
                 OSL_ENSURE(GetShell().IsPreview(),
                             "accessible page frames only in PagePreview" );
-                pAcc = new SwAccessiblePage(shared_from_this(), pFrame);
+                xAcc = new SwAccessiblePage(shared_from_this(), pFrame);
                 break;
             default: break;
             }
-            xAcc = pAcc;
             assert(xAcc.is());
 
             if( aIter != mpFrameMap->end() )
@@ -1822,7 +1820,7 @@ rtl::Reference<SwAccessibleContext> 
SwAccessibleMap::GetContextImpl(const SwFram
                 mpFrameMap->emplace( pFrame, xAcc );
             }
 
-            if( pAcc->HasCursor() &&
+            if (xAcc->HasCursor() &&
                 !AreInSameTable( mxCursorContext, pFrame ) )
             {
                 // If the new context has the focus, and if we know

Reply via email to