diff options
Diffstat (limited to 'package')
-rw-r--r-- | package/inc/zipfileaccess.hxx | 1 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index 59d2accc6329..6b1c1cdc2815 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -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 ); diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 17c5cf27b525..3139c10c526a 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -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& ) |