toolkit/source/awt/vclxaccessiblecomponent.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 51e416dbe4cc41c38573235d1a9598d2a34f44ad
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Dec 11 12:08:53 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 12 08:04:55 2024 +0100

    a11y: Use vcl::Window in VCLXAccessibleComponent::grabFocus
    
    Directly call vcl::Window::GrabFocus instead of
    going via VCLXWindow::setFocus, which does the same.
    
    Change-Id: I2104c09e6b777c6c0deb2e04093cd48ce2aacc55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178306
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx 
b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 6400eadd130c..f5745eee123a 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -753,8 +753,8 @@ void VCLXAccessibleComponent::grabFocus(  )
     OExternalLockGuard aGuard( this );
 
     sal_Int64 nStates = getAccessibleStateSet();
-    if ( m_xVCLXWindow.is() && ( nStates & 
accessibility::AccessibleStateType::FOCUSABLE ) )
-        m_xVCLXWindow->setFocus();
+    if (m_xEventSource && (nStates & 
accessibility::AccessibleStateType::FOCUSABLE))
+        m_xEventSource->GrabFocus();
 }
 
 sal_Int32 SAL_CALL VCLXAccessibleComponent::getForeground(  )
commit eecf7db06b659c4d4d5ffb8240a7760bd89ae5c8
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Dec 11 12:05:40 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 12 08:04:49 2024 +0100

    a11y: Simplify VCLXAccessibleComponent::GetWindow
    
    The ctor assigns
    
        m_xEventSource = pVCLXWindow->GetWindow();
    
    , so return that directly instead of querying it
    from the VCLXWindow again.
    
    Change-Id: Ifacdfb82e95b97c23c57d0cf9da46b77289ad227
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178305
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx 
b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 5de2f2698065..6400eadd130c 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -380,8 +380,7 @@ void VCLXAccessibleComponent::disposing()
 
 vcl::Window* VCLXAccessibleComponent::GetWindow() const
 {
-    return GetVCLXWindow() ? GetVCLXWindow()->GetWindow()
-                           : nullptr;
+    return m_xEventSource;
 }
 
 void VCLXAccessibleComponent::FillAccessibleRelationSet( 
utl::AccessibleRelationSetHelper& rRelationSet )
commit 2e2fec9b0d8f39af8dbc8ba7d637629ba77ebfed
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Dec 11 11:56:22 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 12 08:04:42 2024 +0100

    a11y: Use vcl::Window for VCLXAccessibleComponent validity check
    
    Instead of checking for VCLXWindow reference being non-empty,
    check whether the VclPtr<vcl::Window> ptr is non-empty.
    
    The latter should never be true unless the former is
    because VCLXAccessibleComponent::DisconnectEvents
    gets called before both possible calls to
    
        m_xVCLXWindow.clear();
    
    , and VCLXAccessibleComponent::DisconnectEvents
    clears VCLXAccessibleComponent::m_xEventSource.
    
    No change in behavior intended, but this further
    reduces the use of the toolkit/UNO VCLXWindow
    in favor of using the vcl::Window directly.
    
    While at it, also drop the references to
    tickets that don't provide any additional helpful
    information:
    
    "#122218#" is a reference to the StarDivision internal
    StarOffice bugtracker, which is unavailable
    
    "#i68079#" refers to [1], but also doesn't really
    explain whether/why that check is needed:
    
    From the initial description in that ticket:
    
    > This is a follow-up of the issue 43665...  We still have the patch in
    > ooo-build; it applies in IMPL_LINK( VCLXAccessibleComponent,
    > WindowChildEventListener, VclSimpleEvent*, pEvent ) (few lines below the
    > original problem).  Is it necessary (could it avoid a possible problem), 
or is
    > it just bogus, and not needed?
    
    Reply in comment 1:
    
    > I'm not aware of any known issue, but I think this patch makes sense in
    > order to avoid any potential problems. I will integrate this patch in
    > one of the next childworkspaces.
    
    [1] https://bz.apache.org/ooo/show_bug.cgi?id=68079
    
    Change-Id: I14118cb95db4859ddac57d9646531cdbe0f967f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178304
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/toolkit/source/awt/vclxaccessiblecomponent.cxx 
b/toolkit/source/awt/vclxaccessiblecomponent.cxx
index 33f86114bdca..5de2f2698065 100644
--- a/toolkit/source/awt/vclxaccessiblecomponent.cxx
+++ b/toolkit/source/awt/vclxaccessiblecomponent.cxx
@@ -101,7 +101,7 @@ IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, 
VclWindowEvent&, rEvent
      * might have been destroyed by the previous VCLEventListener (if no AT 
tool
      * is running), e.g. sub-toolbars in impress.
      */
-    if ( m_xVCLXWindow.is() /* #122218# */ && (rEvent.GetId() != 
VclEventId::WindowEndPopupMode) )
+    if (m_xEventSource && (rEvent.GetId() != VclEventId::WindowEndPopupMode))
     {
         DBG_ASSERT( rEvent.GetWindow(), "Window???" );
         if( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() || ( 
rEvent.GetId() == VclEventId::ObjectDying ) )
@@ -113,7 +113,7 @@ IMPL_LINK( VCLXAccessibleComponent, WindowEventListener, 
VclWindowEvent&, rEvent
 
 IMPL_LINK( VCLXAccessibleComponent, WindowChildEventListener, VclWindowEvent&, 
rEvent, void )
 {
-    if ( m_xVCLXWindow.is() /* #i68079# */ )
+    if (m_xEventSource)
     {
         DBG_ASSERT( rEvent.GetWindow(), "Window???" );
         if( !rEvent.GetWindow()->IsAccessibilityEventsSuppressed() )

Reply via email to