toolkit/source/awt/vclxwindow.cxx |    3 +--
 vcl/source/window/menu.cxx        |    8 ++------
 2 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 8a762c35ea517c1ac24d7ca20e190144d5413e71
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Dec 5 10:28:17 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Dec 5 20:10:59 2024 +0100

    a11y: Update comment wrt reference being (not) weak
    
    This was using a weak reference when the comment
    was added in
    
        commit 9b34eb7c8512ebc2a7788692a0c826d4e384d460
        Author: Frank Schönheit <[email protected]>
        Date:   Thu Apr 25 10:24:33 2002 +0000
    
            #98750# be an XEventListener at the AccessibleContext
    
    , but later changed to be a hard reference in
    
        commit 23d689d4e43986c10372da0dd756dbcecd82beb8
        Author: Thomas Benisch <[email protected]>
        Date:   Thu Nov 7 16:19:24 2002 +0000
    
            #103674# change the reference to the accessible context from weak 
to hard
    
    . Unfortunately that commit only references a StarDivision
    internal ticket, so the exact reason remains unclear,
    but at least update the comment.
    
    Change-Id: Icdc9aec97647ae05ae7fb3f2bdc1be43c3a62619
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177848
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/toolkit/source/awt/vclxwindow.cxx 
b/toolkit/source/awt/vclxwindow.cxx
index 7dff40ed4763..ed9e80e506fe 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -2418,8 +2418,7 @@ css::uno::Reference< 
css::accessibility::XAccessibleContext > VCLXWindow::getAcc
         mpImpl->mxAccessibleContext = CreateAccessibleContext();
 
         // add as event listener to this component
-        // in case somebody disposes it, we do not want to have a (though 
weak) reference to a dead
-        // object
+        // in case somebody disposes it, we do not want to have a reference to 
a dead object
         uno::Reference< lang::XComponent > xComp( mpImpl->mxAccessibleContext, 
uno::UNO_QUERY );
         if ( xComp.is() )
             xComp->addEventListener( this );
commit ab38826d9005d206600bfc94d6b7b4986480ecce
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Dec 5 10:20:14 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Dec 5 20:10:46 2024 +0100

    vcl a11y: Use comphelper::disposeComponent
    
    Change-Id: Ifc63db272484e9a7986e6113989f2f6274f40349
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177846
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 581279acd8bf..a8c460629dd4 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -24,6 +24,7 @@
 #include <comphelper/diagnose_ex.hxx>
 #include <sal/log.hxx>
 
+#include <comphelper/types.hxx>
 #include <comphelper/lok.hxx>
 #include <vcl/dialoghelper.hxx>
 #include <vcl/svapp.hxx>
@@ -199,12 +200,7 @@ void Menu::dispose()
     }
 
     // dispose accessible components
-    if ( mxAccessible.is() )
-    {
-        css::uno::Reference< css::lang::XComponent> xComponent( mxAccessible, 
css::uno::UNO_QUERY );
-        if ( xComponent.is() )
-            xComponent->dispose();
-    }
+    comphelper::disposeComponent(mxAccessible);
 
     if ( nEventId )
         Application::RemoveUserEvent( nEventId );

Reply via email to