slideshow/source/engine/slideview.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit a386837e4ea4a15609623916df5217e572480598
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Sep 16 12:10:52 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 19 08:01:06 2024 +0200

    use more concrete UNO types in WeakRefWrapper
    
    Change-Id: I5805a681833003c01b5c06c4719606cb27ab600c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173608
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/slideshow/source/engine/slideview.cxx 
b/slideshow/source/engine/slideview.cxx
index 5c5758bb2831..8582918b2c4b 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
 #include <comphelper/make_shared_from_uno.hxx>
+#include <unotools/weakref.hxx>
 
 #include <cppcanvas/spritecanvas.hxx>
 #include <cppcanvas/customsprite.hxx>
@@ -1018,23 +1019,21 @@ void SlideView::disposing( lang::EventObject const& evt 
)
 // silly wrapper to check that event handlers don't touch dead SlideView
 struct WeakRefWrapper
 {
-    SlideView & m_rObj;
-    uno::WeakReference<uno::XInterface> const m_wObj;
+    unotools::WeakReference<SlideView> const m_wObj;
     std::function<void (SlideView&)> const m_func;
 
     WeakRefWrapper(SlideView & rObj, std::function<void (SlideView&)> func)
-        : m_rObj(rObj)
-        , m_wObj(rObj.getXWeak())
+        : m_wObj(&rObj)
         , m_func(std::move(func))
     {
     }
 
     void operator()()
     {
-        uno::Reference<uno::XInterface> const xObj(m_wObj);
+        rtl::Reference<SlideView> const xObj(m_wObj);
         if (xObj.is())
         {
-            m_func(m_rObj);
+            m_func(*xObj);
         }
     }
 };

Reply via email to