ure/source/uretest/cppmain.cc   |    8 ++++----
 ure/source/uretest/cppserver.cc |    2 +-
 ure/source/uretest/cpptest.cc   |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d9225a59e89907e9d289ab93c44fd8e6883f1be2
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Apr 23 20:15:37 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat May 27 12:05:11 2023 +0200

    Use getXWeak in ure
    
    Change-Id: I5d76890ca1165b74e204b38c5ca9675d40a80823
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150884
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/ure/source/uretest/cppmain.cc b/ure/source/uretest/cppmain.cc
index fb957d9f221a..3346245ccca4 100644
--- a/ure/source/uretest/cppmain.cc
+++ b/ure/source/uretest/cppmain.cc
@@ -131,12 +131,12 @@ private:
         } catch (css::uno::Exception &) {
             throw css::uno::RuntimeException(
                 ::rtl::OUString("error creating instance"),
-                static_cast< ::cppu::OWeakObject * >(this));
+                getXWeak());
         }
         if (!instance.is()) {
             throw css::uno::RuntimeException(
                 "no instance: " + name,
-                static_cast< ::cppu::OWeakObject * >(this));
+                getXWeak());
         }
     }
     css::beans::Introspection::create(context_);
@@ -195,7 +195,7 @@ void Service::test(
         throw css::uno::RuntimeException(
             (name
              + ::rtl::OUString(".throwException failed")),
-            static_cast< ::cppu::OWeakObject * >(this));
+            getXWeak());
     }
 }
 
@@ -204,7 +204,7 @@ namespace CppMain {
 css::uno::Reference< css::uno::XInterface > create(
     css::uno::Reference< css::uno::XComponentContext > const & context)
 {
-    return static_cast< ::cppu::OWeakObject * >(new Service(context));
+    return getXWeak(new Service(context));
 }
 
 rtl::OUString getImplementationName() {
diff --git a/ure/source/uretest/cppserver.cc b/ure/source/uretest/cppserver.cc
index db42c9fb3f9f..6f25bb2591ff 100644
--- a/ure/source/uretest/cppserver.cc
+++ b/ure/source/uretest/cppserver.cc
@@ -57,7 +57,7 @@ namespace CppServer {
 css::uno::Reference< css::uno::XInterface > create(
     css::uno::Reference< css::uno::XComponentContext > const &)
 {
-    return static_cast< ::cppu::OWeakObject * >(new Service);
+    return getXWeak(new Service);
 }
 
 rtl::OUString getImplementationName() {
diff --git a/ure/source/uretest/cpptest.cc b/ure/source/uretest/cpptest.cc
index b037fdceebfb..38302e1bc0d9 100644
--- a/ure/source/uretest/cpptest.cc
+++ b/ure/source/uretest/cpptest.cc
@@ -44,7 +44,7 @@ public:
     virtual void SAL_CALL throwException() {
         throw test::types::TestException(
             rtl::OUString("test"),
-            static_cast< cppu::OWeakObject * >(this));
+            getXWeak());
     }
 
 private:
@@ -59,7 +59,7 @@ namespace CppTest {
 css::uno::Reference< css::uno::XInterface > create(
     css::uno::Reference< css::uno::XComponentContext > const &)
 {
-    return static_cast< cppu::OWeakObject * >(new Service);
+    return getXWeak(new Service);
 }
 
 rtl::OUString getImplementationName() {

Reply via email to