summaryrefslogtreecommitdiff
path: root/ure
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-23 20:15:37 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-05-27 12:05:11 +0200
commitd9225a59e89907e9d289ab93c44fd8e6883f1be2 (patch)
tree0508e7dc15f746a12ddf171b620c3c4d3b9d4211 /ure
parent9e92437cbb2180d51fdabc0d5efff24b530ba27a (diff)
Use getXWeak in ure
Change-Id: I5d76890ca1165b74e204b38c5ca9675d40a80823 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150884 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'ure')
-rw-r--r--ure/source/uretest/cppmain.cc8
-rw-r--r--ure/source/uretest/cppserver.cc2
-rw-r--r--ure/source/uretest/cpptest.cc4
3 files changed, 7 insertions, 7 deletions
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() {