accessibility/inc/extended/accessiblelistboxentry.hxx    |    4 +--
 accessibility/source/extended/accessiblelistboxentry.cxx |   17 +++++++--------
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit e0766ffbf7fae8f250d735ed1473909fcec412c6
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Sep 5 15:59:43 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Sep 5 18:36:29 2023 +0200

    use more concrete types in AccessibleListBoxEntry
    
    which means we only need one field, not two
    
    Change-Id: I0229348a797d0f01f3d35c46563efed161676efb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156568
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/accessibility/inc/extended/accessiblelistboxentry.hxx 
b/accessibility/inc/extended/accessiblelistboxentry.hxx
index 6ae837f4de4b..69b1e702bdb3 100644
--- a/accessibility/inc/extended/accessiblelistboxentry.hxx
+++ b/accessibility/inc/extended/accessiblelistboxentry.hxx
@@ -34,6 +34,7 @@
 #include <comphelper/accessibletexthelper.hxx>
 #include <vcl/toolkit/treelistentry.hxx>
 #include <tools/gen.hxx>
+#include <unotools/weakref.hxx>
 
 // forward ---------------------------------------------------------------
 
@@ -80,8 +81,7 @@ namespace accessibility
         /// client id in the AccessibleEventNotifier queue
         sal_uInt32                          m_nClientId;
 
-        css::uno::WeakReference<css::accessibility::XAccessible> m_wListBox;
-        AccessibleListBox & m_rListBox;
+        unotools::WeakReference<AccessibleListBox> m_wListBox;
 
         tools::Rectangle               GetBoundingBox_Impl() const;
         tools::Rectangle               GetBoundingBoxOnScreen_Impl() const;
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index db994d94fcd1..1f93476daa6a 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -73,7 +73,6 @@ namespace accessibility
         , m_pSvLBoxEntry(&rEntry)
         , m_nClientId( 0 )
         , m_wListBox(&rListBox)
-        , m_rListBox(rListBox)
     {
         m_pTreeListBox->AddEventListener( LINK( this, AccessibleListBoxEntry, 
WindowEventListener ) );
         _rListBox.FillEntryPath( m_pSvLBoxEntry, m_aEntryPath );
@@ -310,10 +309,10 @@ namespace accessibility
         if ( !pEntry )
             throw IndexOutOfBoundsException();
 
-        uno::Reference<XAccessible> xListBox(m_wListBox);
+        rtl::Reference<AccessibleListBox> xListBox(m_wListBox);
         assert(xListBox.is());
 
-        return m_rListBox.implGetAccessible(*pEntry);
+        return xListBox->implGetAccessible(*pEntry);
     }
 
     Reference< XAccessible > AccessibleListBoxEntry::implGetParentAccessible( 
) const
@@ -338,9 +337,9 @@ namespace accessibility
             assert(pParentEntry && 
"AccessibleListBoxEntry::implGetParentAccessible: could not obtain a parent 
entry!");
             if ( pParentEntry )
             {
-                uno::Reference<XAccessible> xListBox(m_wListBox);
+                rtl::Reference<AccessibleListBox> xListBox(m_wListBox);
                 assert(xListBox.is());
-                return m_rListBox.implGetAccessible(*pParentEntry);
+                return xListBox->implGetAccessible(*pParentEntry);
                 // the AccessibleListBoxEntry class will create its parent
                 // when needed
             }
@@ -529,9 +528,9 @@ namespace accessibility
             throw 
RuntimeException("AccessibleListBoxEntry::getAccessibleAtPoint - pEntry cannot 
be empty!");
 
         Reference< XAccessible > xAcc;
-        uno::Reference<XAccessible> xListBox(m_wListBox);
+        rtl::Reference<AccessibleListBox> xListBox(m_wListBox);
         assert(xListBox.is());
-        auto pAccEntry = m_rListBox.implGetAccessible(*pEntry);
+        auto pAccEntry = xListBox->implGetAccessible(*pEntry);
         tools::Rectangle aRect = pAccEntry->GetBoundingBox_Impl();
         if ( aRect.Contains( VCLPoint( _aPoint ) ) )
             xAcc = pAccEntry.get();
@@ -932,9 +931,9 @@ namespace accessibility
 
             if ( nSelCount == ( nSelectedChildIndex + 1 ) )
             {
-                uno::Reference<XAccessible> xListBox(m_wListBox);
+                rtl::Reference<AccessibleListBox> xListBox(m_wListBox);
                 assert(xListBox.is());
-                xChild = m_rListBox.implGetAccessible(*pEntry).get();
+                xChild = xListBox->implGetAccessible(*pEntry).get();
                 break;
             }
         }

Reply via email to