diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-23 20:14:26 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-30 20:35:10 +0200 |
commit | d4d994321464b1f0301c3cb86f55d851794d5f88 (patch) | |
tree | 934998d67d1303629086be96a3ac7babb0d35ef6 | |
parent | d74c010192a3d9605364bfb942f18c9199a75804 (diff) |
Use getXWeak in sax
Change-Id: I24d61be2a1e1c21c08e50790b2d7bbb794c4fb07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150862
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 4 | ||||
-rw-r--r-- | sax/test/sax/testsax.cxx | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 708efc573983..3b75255ee9ef 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1035,8 +1035,8 @@ public: // XActiveDataSource } catch (const SAXException& e) { - throw css::lang::WrappedTargetRuntimeException( - e.Message, static_cast<OWeakObject*>(this), e.WrappedException); + throw css::lang::WrappedTargetRuntimeException(e.Message, getXWeak(), + e.WrappedException); } } virtual Reference<XOutputStream> SAL_CALL getOutputStream() override { return m_out; } diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx index 882a7a96dfa7..b6fa70a93875 100644 --- a/sax/test/sax/testsax.cxx +++ b/sax/test/sax/testsax.cxx @@ -83,8 +83,7 @@ private: /// @note for external binding Reference < XInterface > SAL_CALL OSaxParserTest_CreateInstance( const Reference < XMultiServiceFactory > & rSMgr ) throw(Exception) { - OSaxParserTest *p = new OSaxParserTest( rSMgr ); - return Reference < XInterface > ( (static_cast< OWeakObject * >(p)) ); + return getXWeak(new OSaxParserTest( rSMgr )); } OUString OSaxParserTest_getServiceName( ) throw () |