summaryrefslogtreecommitdiff
path: root/package/source/xstor/owriteablestream.cxx
diff options
context:
space:
mode:
authorHans-Joachim Lankenau <hjs@openoffice.org>2009-03-23 15:36:37 +0000
committerHans-Joachim Lankenau <hjs@openoffice.org>2009-03-23 15:36:37 +0000
commite3426c10419c4c1a2b7335472d715119d34f2049 (patch)
treebecc97ab5ff3f2258b17c3e80965abff19ec7573 /package/source/xstor/owriteablestream.cxx
parent9617814d7ad699776a4b22bf34c187aeba70fdaf (diff)
CWS-TOOLING: integrate CWS dba31j_DEV300
2009-03-11 12:24:24 +0100 iha r269311 : #i100102# report donut charts crash on load 2009-03-11 10:44:35 +0100 oj r269302 : #i100102# export meta.xml 2009-03-11 07:35:03 +0100 oj r269296 : #i99686# not used anymore 2009-03-11 07:34:27 +0100 oj r269295 : #i99686# not used anymore 2009-03-11 07:33:57 +0100 oj r269294 : #i99686# change storage usage 2009-03-10 15:21:41 +0100 mav r269275 : #i99686# test additional scenario 2009-03-10 08:37:10 +0100 mav r269239 : #i100040# calculate the name length correctly 2009-03-10 08:25:16 +0100 mav r269236 : #i99686# workaround to prevent crash while disposing the hierarchical stream 2009-03-10 07:14:05 +0100 oj r269235 : #i99686# fix usage of storage api 2009-03-10 07:13:17 +0100 oj r269234 : #i99686# fix usage of storage api 2009-03-09 13:33:26 +0100 fs r269085 : #i100012# 2009-03-09 13:11:08 +0100 fs r269081 : #i100036# don't store sub documents which have not been touched 2009-03-09 11:21:17 +0100 fs r269070 : #i100040# don't silence errors in impl_storeToStorage_throw 2009-03-09 10:28:48 +0100 oj r269065 : #i100036# throw exception when no activeConnection exists
Diffstat (limited to 'package/source/xstor/owriteablestream.cxx')
-rw-r--r--package/source/xstor/owriteablestream.cxx71
1 files changed, 38 insertions, 33 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 8ecc2a2ca..87918c57b 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -2249,52 +2249,57 @@ void SAL_CALL OWriteStream::dispose()
throw ( uno::RuntimeException )
{
// should be an internal method since it can be called only from parent storage
+ {
+ ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
- ::osl::MutexGuard aGuard( m_pData->m_rSharedMutexRef->GetMutex() );
-
- if ( !m_pImpl )
- throw lang::DisposedException();
-
- if ( m_xOutStream.is() )
- CloseOutput_Impl();
+ if ( !m_pImpl )
+ throw lang::DisposedException();
- if ( m_xInStream.is() )
- {
- m_xInStream->closeInput();
- m_xInStream = uno::Reference< io::XInputStream >();
- }
+ if ( m_xOutStream.is() )
+ CloseOutput_Impl();
- lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) );
- m_pData->m_aListenersContainer.disposeAndClear( aSource );
+ if ( m_xInStream.is() )
+ {
+ m_xInStream->closeInput();
+ m_xInStream = uno::Reference< io::XInputStream >();
+ }
- m_pImpl->m_pAntiImpl = NULL;
+ m_pImpl->m_pAntiImpl = NULL;
- if ( !m_bInitOnDemand )
- {
- try
+ if ( !m_bInitOnDemand )
{
- if ( !m_bTransacted )
+ try
{
- m_pImpl->Commit();
+ if ( !m_bTransacted )
+ {
+ m_pImpl->Commit();
+ }
+ else
+ {
+ // throw away all the changes
+ m_pImpl->Revert();
+ }
}
- else
+ catch( uno::Exception& )
{
- // throw away all the changes
- m_pImpl->Revert();
+ uno::Any aCaught( ::cppu::getCaughtException() );
+ throw lang::WrappedTargetRuntimeException(
+ ::rtl::OUString::createFromAscii( "Can not commit/revert the storage!\n" ),
+ uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ),
+ uno::UNO_QUERY ),
+ aCaught );
}
}
- catch( uno::Exception& )
- {
- uno::Any aCaught( ::cppu::getCaughtException() );
- throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString::createFromAscii( "Can not commit/revert the storage!\n" ),
- uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ),
- uno::UNO_QUERY ),
- aCaught );
- }
+
+ m_pImpl = NULL;
}
- m_pImpl = NULL;
+ // the listener might try to get rid of parent storage, and the storage would delete this object;
+ // for now the listener is just notified at the end of the method to workaround the problem
+ // in future a more elegant way should be found
+
+ lang::EventObject aSource( static_cast< ::cppu::OWeakObject* >(this) );
+ m_pData->m_aListenersContainer.disposeAndClear( aSource );
}
//-----------------------------------------------