package/source/xstor/owriteablestream.cxx |   90 ------------------------------
 1 file changed, 90 deletions(-)

New commits:
commit 6b94423876a7bcd1a016436a7ab9be818f6d4623
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Jun 14 12:16:34 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Jun 14 14:16:34 2025 +0200

    Don't check m_pImpl after CheckInitOnDemand
    
    The latter already does that; avoid useless operations.
    
    Change-Id: Icfa015e605a6091caa53fba4603e16c5c3141135
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186486
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/package/source/xstor/owriteablestream.cxx 
b/package/source/xstor/owriteablestream.cxx
index 1e4799db30cb..27f30a8c453b 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -1868,12 +1868,6 @@ sal_Int32 SAL_CALL OWriteStream::readBytes( 
uno::Sequence< sal_Int8 >& aData, sa
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xInStream.is() )
         throw io::NotConnectedException();
 
@@ -1886,12 +1880,6 @@ sal_Int32 SAL_CALL OWriteStream::readSomeBytes( 
uno::Sequence< sal_Int8 >& aData
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xInStream.is() )
         throw io::NotConnectedException();
 
@@ -1923,12 +1911,6 @@ void SAL_CALL OWriteStream::skipBytes( sal_Int32 
nBytesToSkip )
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xInStream.is() )
         throw io::NotConnectedException();
 
@@ -1941,12 +1923,6 @@ sal_Int32 SAL_CALL OWriteStream::available(  )
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xInStream.is() )
         throw io::NotConnectedException();
 
@@ -1958,12 +1934,6 @@ void SAL_CALL OWriteStream::closeInput(  )
 {
     ::osl::MutexGuard aGuard( m_xSharedMutex->GetMutex() );
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_bInitOnDemand && ( m_bInStreamDisconnected || !m_xInStream.is() ) )
         throw io::NotConnectedException();
 
@@ -1981,12 +1951,6 @@ uno::Reference< io::XInputStream > SAL_CALL 
OWriteStream::getInputStream()
 {
     ::osl::MutexGuard aGuard( m_xSharedMutex->GetMutex() );
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_bInitOnDemand && ( m_bInStreamDisconnected || !m_xInStream.is() ) )
         return uno::Reference< io::XInputStream >();
 
@@ -2007,12 +1971,6 @@ uno::Reference< io::XOutputStream > SAL_CALL 
OWriteStream::getOutputStream()
                 getXWeak(), css::uno::Any ( r ) );
     }
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xOutStream.is() )
         return uno::Reference< io::XOutputStream >();
 
@@ -2208,12 +2166,6 @@ void SAL_CALL OWriteStream::closeOutput()
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xOutStream.is() )
         throw io::NotConnectedException();
 
@@ -2229,12 +2181,6 @@ void SAL_CALL OWriteStream::seek( sal_Int64 location )
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xSeekable.is() )
         throw uno::RuntimeException();
 
@@ -2247,12 +2193,6 @@ sal_Int64 SAL_CALL OWriteStream::getPosition()
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xSeekable.is() )
         throw uno::RuntimeException();
 
@@ -2265,12 +2205,6 @@ sal_Int64 SAL_CALL OWriteStream::getLength()
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xSeekable.is() )
         throw uno::RuntimeException();
 
@@ -2283,12 +2217,6 @@ void SAL_CALL OWriteStream::truncate()
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     if ( !m_xOutStream.is() )
         throw uno::RuntimeException();
 
@@ -2396,12 +2324,6 @@ void SAL_CALL OWriteStream::setEncryptionPassword( const 
OUString& aPass )
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     OSL_ENSURE( m_pImpl->m_xPackageStream.is(), "No package stream is set!" );
 
     m_pImpl->SetEncrypted( 
::comphelper::OStorageHelper::CreatePackageEncryptionData( aPass ) );
@@ -2415,12 +2337,6 @@ void SAL_CALL OWriteStream::removeEncryption()
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     OSL_ENSURE( m_pImpl->m_xPackageStream.is(), "No package stream is set!" );
 
     m_pImpl->SetDecrypted();
@@ -2434,12 +2350,6 @@ void SAL_CALL OWriteStream::setEncryptionData( const 
uno::Sequence< beans::Named
 
     CheckInitOnDemand();
 
-    if ( !m_pImpl )
-    {
-        SAL_INFO("package.xstor", "Disposed!");
-        throw lang::DisposedException();
-    }
-
     OSL_ENSURE( m_pImpl->m_xPackageStream.is(), "No package stream is set!" );
 
     m_pImpl->SetEncrypted( aEncryptionData );

Reply via email to