From 0dcbf8a5a5048b30fce48081090a922d286a62e4 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 23 Apr 2023 20:14:51 +0300 Subject: [PATCH] Use getXWeak in sot Change-Id: I68d6b7393b367b68206c92cd65705326c5aeda7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150870 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sot/source/sdstor/ucbstorage.cxx | 8 ++++---- sot/source/unoolestorage/xolesimplestorage.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index e9857af608cd..8ded02a7b139 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -147,7 +147,7 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::readBytes(Sequence< sal_Int8 >& aData checkConnected(); if (nBytesToRead < 0) - throw BufferSizeExceededException(OUString(),static_cast(this)); + throw BufferSizeExceededException(OUString(), getXWeak()); std::scoped_lock aGuard( m_aMutex ); @@ -176,7 +176,7 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::readSomeBytes(Sequence< sal_Int8 >& a checkError(); if (nMaxBytesToRead < 0) - throw BufferSizeExceededException(OUString(),static_cast(this)); + throw BufferSizeExceededException(OUString(), getXWeak()); if (m_pSvStream->eof()) { @@ -278,7 +278,7 @@ sal_Int64 SAL_CALL FileStreamWrapper_Impl::getLength( ) void FileStreamWrapper_Impl::checkConnected() { if ( m_aURL.isEmpty() ) - throw NotConnectedException(OUString(), static_cast(this)); + throw NotConnectedException(OUString(), getXWeak()); if ( !m_pSvStream ) { m_pSvStream = ::utl::UcbStreamHelper::CreateStream( m_aURL, StreamMode::STD_READ ); @@ -295,7 +295,7 @@ void FileStreamWrapper_Impl::checkError() if (m_pSvStream->SvStream::GetError() != ERRCODE_NONE) // TODO: really evaluate the error - throw NotConnectedException(OUString(), static_cast(this)); + throw NotConnectedException(OUString(), getXWeak()); } diff --git a/sot/source/unoolestorage/xolesimplestorage.cxx b/sot/source/unoolestorage/xolesimplestorage.cxx index d64937d9b4e0..d2cb93a04647 100644 --- a/sot/source/unoolestorage/xolesimplestorage.cxx +++ b/sot/source/unoolestorage/xolesimplestorage.cxx @@ -550,7 +550,7 @@ void SAL_CALL OLESimpleStorage::dispose() if ( m_aListenersContainer.getLength(aGuard) ) { - lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) ); + lang::EventObject aSource( getXWeak() ); m_aListenersContainer.disposeAndClear( aGuard, aSource ); }