From a43a18edb0023b2a9533e719c8cf3dd2f894dad7 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Fri, 2 Aug 2013 23:35:20 +0200 Subject: do *not* silently ignore errors when saving libraries In case of error, it leads to *data* *loss*. Change-Id: I80d806ef10a3364174eced3095ebf1ea217d75b4 --- basic/source/uno/namecont.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'basic') diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index e49a84642636..62577316f22d 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -1924,7 +1924,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto << rLib.aName << "\". Exception: " << comphelper::anyToString(aError)); #endif - return; + throw; } } @@ -1954,6 +1954,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto { DBG_UNHANDLED_EXCEPTION(); // TODO: error handling + throw; } } } @@ -2033,6 +2034,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); + throw; } } @@ -2384,7 +2386,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) << "\". Exception: " << comphelper::anyToString(aError)); #endif - return; + throw; } } @@ -2418,12 +2420,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) aFile = aElementName; aFile += "."; aFile += maLibElementFileExtension; - try - { - xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ ); - } - catch(const uno::Exception& ) - {} + xElementStream = xLibraryStor->openStreamElement( aFile, embed::ElementModes::READ ); } if ( xElementStream.is() ) @@ -2436,7 +2433,7 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) "basic", "couldn't open library element stream - attempted to" " open library \"" << Name << '"'); - return; + throw RuntimeException("couln't open library element stream", *this); } } else -- cgit