diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-11-11 16:39:10 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-11-11 17:00:43 +0100 |
commit | 3f899eae02eaad0b967de749fe09b869ba93ad6d (patch) | |
tree | 4b2cef6baf0bed987adfb9e2d4bc5b1833c0ad53 /oox | |
parent | 9decde005bc32c7fa495621548f6310737a89120 (diff) |
oox: ZipStorage: better exception tracing
Change-Id: I2b81f92cea8a8c9577c3f9ca33b915942708330c
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/zipstorage.cxx | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx index 4ddb09e417b7..1845afdc7c89 100644 --- a/oox/source/helper/zipstorage.cxx +++ b/oox/source/helper/zipstorage.cxx @@ -67,8 +67,10 @@ ZipStorage::ZipStorage( const Reference< XComponentContext >& rxContext, const R ZIP_STORAGE_FORMAT_STRING, rxInStream, xFactory, sal_False ); // DEV300_m80: Was sal_True, but DOCX and others did not load } - catch( Exception& ) + catch (Exception const& e) { + SAL_WARN("oox.storage", "ZipStorage::ZipStorage " + "exception opening input storage: " << e.Message); } } @@ -84,9 +86,10 @@ ZipStorage::ZipStorage( const Reference< XComponentContext >& rxContext, const R mxStorage = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( OFOPXML_STORAGE_FORMAT_STRING, rxStream, nOpenMode, xFactory, sal_True ); } - catch( Exception& ) + catch (Exception const& e) { - OSL_FAIL( "ZipStorage::ZipStorage - cannot open output storage" ); + SAL_WARN("oox.storage", "ZipStorage::ZipStorage " + "exception opening output storage: " << e.Message); } } @@ -94,7 +97,8 @@ ZipStorage::ZipStorage( const ZipStorage& rParentStorage, const Reference< XStor StorageBase( rParentStorage, rElementName, rParentStorage.isReadOnly() ), mxStorage( rxStorage ) { - OSL_ENSURE( mxStorage.is(), "ZipStorage::ZipStorage - missing storage" ); + SAL_WARN_IF(!mxStorage.is(), "oox.storage", "ZipStorage::ZipStorage " + " - missing storage" ); } ZipStorage::~ZipStorage() @@ -120,8 +124,9 @@ void ZipStorage::implGetElementNames( ::std::vector< OUString >& orElementNames if( aNames.getLength() > 0 ) orElementNames.insert( orElementNames.end(), aNames.getConstArray(), aNames.getConstArray() + aNames.getLength() ); } - catch( Exception& ) + catch (Exception const& e) { + SAL_INFO("oox.storage", "getElementNames: exception: " << e.Message); } } @@ -140,8 +145,9 @@ StorageRef ZipStorage::implOpenSubStorage( const OUString& rElementName, bool bC { bMissing = true; } - catch( Exception& ) + catch (Exception const& e) { + SAL_INFO("oox.storage", "openStorageElement: exception: " << e.Message); } if( bMissing && bCreateMissing ) try @@ -149,8 +155,9 @@ StorageRef ZipStorage::implOpenSubStorage( const OUString& rElementName, bool bC xSubXStorage = mxStorage->openStorageElement( rElementName, ::com::sun::star::embed::ElementModes::READWRITE ); } - catch( Exception& ) + catch (Exception const& e) { + SAL_INFO("oox.storage", "openStorageElement: exception: " << e.Message); } StorageRef xSubStorage; @@ -166,8 +173,9 @@ Reference< XInputStream > ZipStorage::implOpenInputStream( const OUString& rElem { xInStream.set( mxStorage->openStreamElement( rElementName, ::com::sun::star::embed::ElementModes::READ ), UNO_QUERY ); } - catch( Exception& ) + catch (Exception const& e) { + SAL_INFO("oox.storage", "openStreamElement: exception: " << e.Message); } return xInStream; } @@ -179,8 +187,9 @@ Reference< XOutputStream > ZipStorage::implOpenOutputStream( const OUString& rEl { xOutStream.set( mxStorage->openStreamElement( rElementName, ::com::sun::star::embed::ElementModes::READWRITE ), UNO_QUERY ); } - catch( Exception& ) + catch (Exception const& e) { + SAL_INFO("oox.storage", "openStreamElement: exception: " << e.Message); } return xOutStream; } @@ -191,8 +200,9 @@ void ZipStorage::implCommit() const { Reference< XTransactedObject >( mxStorage, UNO_QUERY_THROW )->commit(); } - catch( Exception& ) + catch (Exception const& e) { + SAL_WARN("oox.storage", "commit: exception: " << e.Message); } } |