From 87276a497d9aa8a3f8ac0bfceb75d64938945f9a Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 23 Apr 2023 20:14:07 +0300 Subject: Use getXWeak in io Change-Id: If2b40ecdca67c6d82ff1a87443cb8533401e9ae8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150856 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- io/test/stm/datatest.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'io/test/stm/datatest.cxx') diff --git a/io/test/stm/datatest.cxx b/io/test/stm/datatest.cxx index a085bf6d7d5b..ef31f099d496 100644 --- a/io/test/stm/datatest.cxx +++ b/io/test/stm/datatest.cxx @@ -326,8 +326,7 @@ void ODataStreamTest::testSimple( const Reference < XDataInputStream > &rInput **/ Reference < XInterface > SAL_CALL ODataStreamTest_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception) { - ODataStreamTest *p = new ODataStreamTest( rSMgr ); - return Reference < XInterface > ( (static_cast< OWeakObject * >(p)) ); + return getXWeak(new ODataStreamTest( rSMgr )); } Sequence ODataStreamTest_getSupportedServiceNames( int i) throw () @@ -596,8 +595,7 @@ Reference < XInterface > SAL_CALL OMyPersistObject_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception) { - MyPersistObject *p = new MyPersistObject( ); - return Reference < XInterface > ( (static_cast< OWeakObject * >(p)) ); + return getXWeak(new MyPersistObject( )); } Sequence OMyPersistObject_getSupportedServiceNames( ) throw () @@ -1040,8 +1038,7 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > Reference < XInterface > SAL_CALL OObjectStreamTest_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception) { - OObjectStreamTest *p = new OObjectStreamTest( rSMgr ); - return Reference < XInterface > ( (static_cast< OWeakObject * >(p)) ); + return getXWeak(new OObjectStreamTest( rSMgr )); } Sequence OObjectStreamTest_getSupportedServiceNames( int i) throw () -- cgit