include/svtools/editbrowsebox.hxx           |    8 ++++----
 include/svx/gridctrl.hxx                    |    7 +++----
 include/vcl/accessibletableprovider.hxx     |    2 +-
 include/vcl/toolkit/svtabbx.hxx             |    2 +-
 svtools/source/brwbox/editbrowsebox.cxx     |    5 +++--
 svtools/source/brwbox/editbrowsebox2.cxx    |   20 ++++++++++----------
 svtools/source/control/accessibletabbar.cxx |   26 +++++++++++++-------------
 svtools/source/control/accessibletabbar.hxx |    2 +-
 svx/source/fmcomp/gridctrl.cxx              |   14 +++++---------
 vcl/source/treelist/svtabbx.cxx             |    5 ++---
 10 files changed, 43 insertions(+), 48 deletions(-)

New commits:
commit 7dd43a8fbc6813a1525b142fd5721a9f01167ee2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 15:47:49 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Aug 1 11:30:56 2025 +0200

    a11y: Return OAccessible in 
IAccessibleTableProvider::CreateAccessibleControl
    
    Change-Id: I60e3b20f9d129226985679bdf2f1cf83faf86594
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188624
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/svtools/editbrowsebox.hxx 
b/include/svtools/editbrowsebox.hxx
index 45014d765c8f..71df50a9b045 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -1079,9 +1079,9 @@ namespace svt
             @param nIndex
                 The 0-based index of the control.
             @return
-                The XAccessible interface of the specified control. */
-        virtual css::uno::Reference< css::accessibility::XAccessible >
-        CreateAccessibleControl( sal_Int32 nIndex ) override;
+                The accessible object of the specified control. */
+        virtual rtl::Reference<comphelper::OAccessible>
+        CreateAccessibleControl(sal_Int32 nIndex) override;
 
         /** Sets focus to current cell of the data table. */
         virtual void GrabTableFocus() override;
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index ac85e232f6b0..413a02b62cf9 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -543,11 +543,10 @@ public:
         @param _nIndex
             The 0-based index of the control.
         @return
-            The XAccessible interface of the specified control.
+            The accessible object of the specified control.
     */
-    virtual css::uno::Reference<
-        css::accessibility::XAccessible >
-    CreateAccessibleControl( sal_Int32 _nIndex ) override;
+    virtual rtl::Reference<comphelper::OAccessible>
+    CreateAccessibleControl(sal_Int32 _nIndex) override;
 
     // IAccessibleTableProvider
     /** Creates the accessible object of a data table cell.
diff --git a/include/vcl/accessibletableprovider.hxx 
b/include/vcl/accessibletableprovider.hxx
index d976f1d98111..01421fabc0c4 100644
--- a/include/vcl/accessibletableprovider.hxx
+++ b/include/vcl/accessibletableprovider.hxx
@@ -91,7 +91,7 @@ public:
     virtual css::uno::Reference< css::accessibility::XAccessible > 
CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) = 0;
 
     virtual sal_Int32               GetAccessibleControlCount() const = 0;
-    virtual css::uno::Reference< css::accessibility::XAccessible >             
       CreateAccessibleControl( sal_Int32 _nIndex ) = 0;
+    virtual rtl::Reference<comphelper::OAccessible> 
CreateAccessibleControl(sal_Int32 _nIndex) = 0;
     virtual bool                    ConvertPointToControlIndex( sal_Int32& 
_rnIndex, const Point& _rPoint ) = 0;
 
     virtual bool                    ConvertPointToCellAddress( sal_Int32& 
_rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) = 0;
diff --git a/include/vcl/toolkit/svtabbx.hxx b/include/vcl/toolkit/svtabbx.hxx
index 43b4cf388998..e32b663cd360 100644
--- a/include/vcl/toolkit/svtabbx.hxx
+++ b/include/vcl/toolkit/svtabbx.hxx
@@ -169,7 +169,7 @@ public:
     virtual css::uno::Reference< css::accessibility::XAccessible > 
CreateAccessibleColumnHeader( sal_uInt16 _nColumnPos ) override;
 
     virtual sal_Int32               GetAccessibleControlCount() const override;
-    virtual css::uno::Reference< css::accessibility::XAccessible > 
CreateAccessibleControl( sal_Int32 _nIndex ) override;
+    rtl::Reference<comphelper::OAccessible> CreateAccessibleControl(sal_Int32 
_nIndex) override;
     virtual bool                    ConvertPointToControlIndex( sal_Int32& 
_rnIndex, const Point& _rPoint ) override;
 
     virtual bool                    ConvertPointToCellAddress( sal_Int32& 
_rnRow, sal_uInt16& _rnColPos, const Point& _rPoint ) override;
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx 
b/svtools/source/brwbox/editbrowsebox2.cxx
index 84095a83244e..4f4bcc251d83 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -79,8 +79,7 @@ void EditBrowseBox::implCreateActiveAccessible( )
     commitBrowseBoxEvent(CHILD, 
Any(css::uno::Reference<XAccessible>(m_pActiveCell)), Any());
 }
 
-
-Reference< XAccessible > EditBrowseBox::CreateAccessibleControl( sal_Int32 
_nIndex )
+rtl::Reference<comphelper::OAccessible> 
EditBrowseBox::CreateAccessibleControl(sal_Int32 _nIndex)
 {
     DBG_ASSERT( 0 == _nIndex, "EditBrowseBox::CreateAccessibleControl: invalid 
index!" );
 
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 942d7afb84cc..280518c56ebc 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -3386,16 +3386,12 @@ sal_Int32 DbGridControl::GetAccessibleControlCount() 
const
     return EditBrowseBox::GetAccessibleControlCount() + 1; // the navigation 
control
 }
 
-Reference<XAccessible > DbGridControl::CreateAccessibleControl( sal_Int32 
_nIndex )
+rtl::Reference<comphelper::OAccessible> 
DbGridControl::CreateAccessibleControl(sal_Int32 _nIndex)
 {
-    Reference<XAccessible > xRet;
-    if ( _nIndex == EditBrowseBox::GetAccessibleControlCount() )
-    {
-        xRet = m_aBar->GetAccessible();
-    }
-    else
-        xRet = EditBrowseBox::CreateAccessibleControl( _nIndex );
-    return xRet;
+    if (_nIndex == EditBrowseBox::GetAccessibleControlCount())
+        return m_aBar->GetAccessible();
+
+    return EditBrowseBox::CreateAccessibleControl(_nIndex);
 }
 
 Reference< XAccessible > DbGridControl::CreateAccessibleCell( sal_Int32 _nRow, 
sal_uInt16 _nColumnPos )
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index fa1f0a8f729f..c59bc44c1e4f 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -883,10 +883,9 @@ sal_Int32 SvHeaderTabListBox::GetAccessibleControlCount() 
const
     return -1;
 }
 
-Reference< XAccessible > SvHeaderTabListBox::CreateAccessibleControl( 
sal_Int32 )
+rtl::Reference<comphelper::OAccessible> 
SvHeaderTabListBox::CreateAccessibleControl(sal_Int32)
 {
-    Reference< XAccessible > xControl;
-    return xControl;
+    return {};
 }
 
 bool SvHeaderTabListBox::ConvertPointToControlIndex( sal_Int32&, const Point& )
commit fb1a0074bc97a04665fd9f258121c57a88b64d26
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 15:53:14 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Aug 1 11:30:50 2025 +0200

    svtools a11y: Switch EditBrowseBox::m_xActiveCell to OAccessible
    
    ... from using the abstract XAccessible UNO interface.
    
    Change-Id: I4203548185f311655984bc2e70f636bc4f73913a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188623
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/svtools/editbrowsebox.hxx 
b/include/svtools/editbrowsebox.hxx
index 9d0ccd69ffba..45014d765c8f 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -956,7 +956,7 @@ namespace svt
 
         EditBrowseBoxFlags  m_nBrowserFlags;
 
-        css::uno::Reference<css::accessibility::XAccessible> m_xActiveCell;
+        rtl::Reference<comphelper::OAccessible> m_pActiveCell;
         void clearActiveCell();
 
     protected:
diff --git a/svtools/source/brwbox/editbrowsebox.cxx 
b/svtools/source/brwbox/editbrowsebox.cxx
index 3c5682bc9bb3..6904effc94be 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -1008,9 +1008,10 @@ void EditBrowseBox::DeactivateCell(bool bUpdate)
     if (!IsEditing())
         return;
 
-    if (isAccessibleAlive() && m_xActiveCell.is())
+    if (isAccessibleAlive() && m_pActiveCell.is())
     {
-        commitBrowseBoxEvent(AccessibleEventId::CHILD, Any(), 
Any(m_xActiveCell));
+        commitBrowseBoxEvent(AccessibleEventId::CHILD, Any(),
+                             
Any(css::uno::Reference<XAccessible>(m_pActiveCell)));
         clearActiveCell();
     }
 
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx 
b/svtools/source/brwbox/editbrowsebox2.cxx
index 27d10b9dbd70..84095a83244e 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -58,10 +58,11 @@ sal_Int32 EditBrowseBox::GetAccessibleControlCount() const
 void EditBrowseBox::implCreateActiveAccessible( )
 {
     DBG_ASSERT( IsEditing(), "EditBrowseBox::implCreateActiveAccessible: not 
to be called if we're not editing currently!" );
-    DBG_ASSERT( !m_xActiveCell.is(), 
"EditBrowseBox::implCreateActiveAccessible: not to be called if the old one is 
still alive!" );
+    DBG_ASSERT(!m_pActiveCell.is(), 
"EditBrowseBox::implCreateActiveAccessible: not to be called "
+                                    "if the old one is still alive!");
 
-    if (m_xActiveCell.is() || !IsEditing())
-         return;
+    if (m_pActiveCell.is() || !IsEditing())
+        return;
 
     ControlBase& rControl = aController->GetWindow();
 
@@ -73,9 +74,9 @@ void EditBrowseBox::implCreateActiveAccessible( )
           + ", " + SvtResId(STR_ACC_ROW_NUM).replaceAll("%ROWNUMBER", 
OUString::number(nRow));
     rControl.SetAccessibleName(sAccName);
 
-    m_xActiveCell = rControl.GetAccessible();
+    m_pActiveCell = rControl.GetAccessible();
 
-    commitBrowseBoxEvent(CHILD, Any(m_xActiveCell), Any());
+    commitBrowseBoxEvent(CHILD, 
Any(css::uno::Reference<XAccessible>(m_pActiveCell)), Any());
 }
 
 
@@ -85,14 +86,14 @@ Reference< XAccessible > 
EditBrowseBox::CreateAccessibleControl( sal_Int32 _nInd
 
     if ( isAccessibleAlive() )
     {
-        if (!m_xActiveCell.is())
+        if (!m_pActiveCell.is())
             implCreateActiveAccessible();
     }
 
-    return m_xActiveCell;
+    return m_pActiveCell;
 }
 
-void EditBrowseBox::clearActiveCell() { m_xActiveCell.clear(); }
+void EditBrowseBox::clearActiveCell() { m_pActiveCell.clear(); }
 
 void EditBrowseBox::GrabTableFocus()
 {
commit 1ce3c5507c20455c6be55a7931e01bb011d2e5a6
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Jul 30 15:41:18 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Aug 1 11:30:44 2025 +0200

    a11y: Use OAccessible vector for AccessibleTabBar children
    
    This also drops the need to query for the XComponent
    interface in AccessibleTabBar::disposing.
    
    Change-Id: I8c2c1935c6e505f862b203314b12342ec02cc4da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188622
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svtools/source/control/accessibletabbar.cxx 
b/svtools/source/control/accessibletabbar.cxx
index 51ca4e56e798..c70620a1917d 100644
--- a/svtools/source/control/accessibletabbar.cxx
+++ b/svtools/source/control/accessibletabbar.cxx
@@ -50,7 +50,7 @@ AccessibleTabBar::AccessibleTabBar( TabBar* pTabBar )
     :ImplInheritanceHelper( pTabBar )
 {
     if ( m_pTabBar )
-        m_aAccessibleChildren.assign( 
m_pTabBar->GetAccessibleChildWindowCount() + 1, Reference< XAccessible >() );
+        
m_aAccessibleChildren.assign(m_pTabBar->GetAccessibleChildWindowCount() + 1, 
{});
 }
 
 
@@ -155,11 +155,10 @@ void AccessibleTabBar::disposing()
     AccessibleTabBarBase::disposing();
 
     // dispose all children
-    for (const Reference<XAccessible>& i : m_aAccessibleChildren)
+    for (const rtl::Reference<comphelper::OAccessible>& pChild : 
m_aAccessibleChildren)
     {
-        Reference< XComponent > xComponent( i, UNO_QUERY );
-        if ( xComponent.is() )
-            xComponent->dispose();
+        if (pChild.is())
+            pChild->dispose();
     }
     m_aAccessibleChildren.clear();
 }
@@ -203,8 +202,8 @@ Reference< XAccessible > 
AccessibleTabBar::getAccessibleChild( sal_Int64 i )
     if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
         throw IndexOutOfBoundsException();
 
-    Reference< XAccessible > xChild = m_aAccessibleChildren[i];
-    if ( !xChild.is() )
+    rtl::Reference<comphelper::OAccessible> pChild = m_aAccessibleChildren[i];
+    if (!pChild.is())
     {
         if ( m_pTabBar )
         {
@@ -212,21 +211,22 @@ Reference< XAccessible > 
AccessibleTabBar::getAccessibleChild( sal_Int64 i )
 
             if ( i < nCount )
             {
-                vcl::Window* pChild = m_pTabBar->GetAccessibleChildWindow( 
static_cast<sal_uInt16>(i) );
-                if ( pChild )
-                    xChild = pChild->GetAccessible();
+                vcl::Window* pChildWin
+                    = 
m_pTabBar->GetAccessibleChildWindow(static_cast<sal_uInt16>(i));
+                if (pChildWin)
+                    pChild = pChildWin->GetAccessible();
             }
             else if ( i == nCount )
             {
-                xChild = new AccessibleTabBarPageList( m_pTabBar, i );
+                pChild = new AccessibleTabBarPageList(m_pTabBar, i);
             }
 
             // insert into child list
-            m_aAccessibleChildren[i] = xChild;
+            m_aAccessibleChildren[i] = pChild;
         }
     }
 
-    return xChild;
+    return pChild;
 }
 
 
diff --git a/svtools/source/control/accessibletabbar.hxx 
b/svtools/source/control/accessibletabbar.hxx
index c66700707889..1f2774336671 100644
--- a/svtools/source/control/accessibletabbar.hxx
+++ b/svtools/source/control/accessibletabbar.hxx
@@ -33,7 +33,7 @@ namespace accessibility
 class AccessibleTabBar final
     : public cppu::ImplInheritanceHelper<AccessibleTabBarBase, 
css::lang::XServiceInfo>
 {
-    std::vector<css::uno::Reference<css::accessibility::XAccessible>> 
m_aAccessibleChildren;
+    std::vector<rtl::Reference<comphelper::OAccessible>> m_aAccessibleChildren;
 
     virtual void            ProcessWindowEvent( const VclWindowEvent& 
rVclWindowEvent ) override;
     void            FillAccessibleStateSet( sal_Int64& rStateSet );

Reply via email to