Kaydet (Commit) 28619201 authored tarafından David Tardon's avatar David Tardon

do not close input, unless it was us who opened it

Change-Id: I6ffedd1e64e48b4fc4bd6f5eb63e96b49f1a8508
üst 7d432a9e
......@@ -51,6 +51,7 @@ class OZipFileAccess : public ::cppu::WeakImplHelper4<
::cppu::OInterfaceContainerHelper* m_pListenersContainer;
sal_Bool m_bDisposed;
bool m_bOwnContent;
public:
OZipFileAccess( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
......
......@@ -43,6 +43,7 @@ OZipFileAccess::OZipFileAccess( const uno::Reference< uno::XComponentContext >&
, m_pZipFile( NULL )
, m_pListenersContainer( NULL )
, m_bDisposed( sal_False )
, m_bOwnContent( false )
{
if ( !rxContext.is() )
throw uno::RuntimeException(OSL_LOG_PREFIX, uno::Reference< uno::XInterface >() );
......@@ -188,6 +189,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu
if ( aContent.openStream ( xSink ) )
{
m_xContentStream = xSink->getInputStream();
m_bOwnContent = true;
xSeekable = uno::Reference< io::XSeekable >( m_xContentStream, uno::UNO_QUERY );
}
}
......@@ -385,7 +387,7 @@ void SAL_CALL OZipFileAccess::dispose()
m_pZipFile = NULL;
}
if ( m_xContentStream.is() )
if ( m_xContentStream.is() && m_bOwnContent )
try {
m_xContentStream->closeInput();
} catch( uno::Exception& )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment