From 3f899eae02eaad0b967de749fe09b869ba93ad6d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sun, 11 Nov 2012 16:39:10 +0100 Subject: oox: ZipStorage: better exception tracing Change-Id: I2b81f92cea8a8c9577c3f9ca33b915942708330c --- oox/source/helper/zipstorage.cxx | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'oox') 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); } } -- cgit reoffice-7-6+backports'>distro/collabora/libreoffice-7-6+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-08 20:48:14 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-08 21:01:06 +0200
commit228659f0a60839e7a9de320509c60fa97d44cab6 (patch)
treea819710110533d67225019aeafbd0b64c6951640 /unotools
parent9210f1a50a374b824f02fb43a57cdbbbb714d26c (diff)