Kaydet (Commit) 54227c9a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Silence loplugin:unnecessarycatchthrow with --disable-debug

(An alternative fix could be to suppress warnings for catch blocks containing
preprocessor conditionals, but as these two places seem to be the only ones
affected, keep it simple for now.)

Change-Id: Ia83e56d1eab69bb2920ffdbbfc2182addce47963
Reviewed-on: https://gerrit.libreoffice.org/47331Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst d70dc81f
...@@ -1926,24 +1926,26 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto ...@@ -1926,24 +1926,26 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
uno::Reference< embed::XStorage > xLibraryStor; uno::Reference< embed::XStorage > xLibraryStor;
if( bStorage ) if( bStorage )
{ {
#if OSL_DEBUG_LEVEL > 0
try try
{ {
#endif
xLibraryStor = xTargetLibrariesStor->openStorageElement( xLibraryStor = xTargetLibrariesStor->openStorageElement(
rLib.aName, rLib.aName,
embed::ElementModes::READWRITE ); embed::ElementModes::READWRITE );
#if OSL_DEBUG_LEVEL > 0
} }
catch(const uno::Exception& ) catch(const uno::Exception& )
{ {
#if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() ); Any aError( ::cppu::getCaughtException() );
SAL_WARN( SAL_WARN(
"basic", "basic",
"couldn't create sub storage for library \"" "couldn't create sub storage for library \""
<< rLib.aName << "\". Exception: " << rLib.aName << "\". Exception: "
<< comphelper::anyToString(aError)); << comphelper::anyToString(aError));
#endif
throw; throw;
} }
#endif
} }
// Maybe lib is not loaded?! // Maybe lib is not loaded?!
...@@ -2319,8 +2321,10 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) ...@@ -2319,8 +2321,10 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
uno::Reference< embed::XStorage > xLibraryStor; uno::Reference< embed::XStorage > xLibraryStor;
if( bStorage ) if( bStorage )
{ {
#if OSL_DEBUG_LEVEL > 0
try try
{ {
#endif
xLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READ ); xLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READ );
SAL_WARN_IF( SAL_WARN_IF(
!xLibrariesStor.is(), "basic", !xLibrariesStor.is(), "basic",
...@@ -2340,19 +2344,19 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name ) ...@@ -2340,19 +2344,19 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
{ {
throw uno::RuntimeException("null returned from openStorageElement"); throw uno::RuntimeException("null returned from openStorageElement");
} }
#if OSL_DEBUG_LEVEL > 0
} }
catch(const uno::Exception& ) catch(const uno::Exception& )
{ {
#if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() ); Any aError( ::cppu::getCaughtException() );
SAL_WARN( SAL_WARN(
"basic", "basic",
"couldn't open sub storage for library \"" << Name "couldn't open sub storage for library \"" << Name
<< "\". Exception: " << "\". Exception: "
<< comphelper::anyToString(aError)); << comphelper::anyToString(aError));
#endif
throw; throw;
} }
#endif
} }
Sequence< OUString > aNames = pImplLib->getElementNames(); Sequence< OUString > aNames = pImplLib->getElementNames();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment