summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-03 17:41:44 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-04 08:06:13 +0100
commit54227c9a2084d4b46c6ada96f1cc968c387ad893 (patch)
tree82ac7e14d9691787db2895c31d796f6746be5f63 /basic
parentd70dc81f32d984cc045d4448e7ac89f79f05a8af (diff)
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/47331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/uno/namecont.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 54b2f8eb1bf1..de80d937711b 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -1926,24 +1926,26 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
uno::Reference< embed::XStorage > xLibraryStor;
if( bStorage )
{
+#if OSL_DEBUG_LEVEL > 0
try
{
+#endif
xLibraryStor = xTargetLibrariesStor->openStorageElement(
rLib.aName,
embed::ElementModes::READWRITE );
+#if OSL_DEBUG_LEVEL > 0
}
catch(const uno::Exception& )
{
- #if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() );
SAL_WARN(
"basic",
"couldn't create sub storage for library \""
<< rLib.aName << "\". Exception: "
<< comphelper::anyToString(aError));
- #endif
throw;
}
+#endif
}
// Maybe lib is not loaded?!
@@ -2319,8 +2321,10 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
uno::Reference< embed::XStorage > xLibraryStor;
if( bStorage )
{
+#if OSL_DEBUG_LEVEL > 0
try
{
+#endif
xLibrariesStor = mxStorage->openStorageElement( maLibrariesDir, embed::ElementModes::READ );
SAL_WARN_IF(
!xLibrariesStor.is(), "basic",
@@ -2340,19 +2344,19 @@ void SAL_CALL SfxLibraryContainer::loadLibrary( const OUString& Name )
{
throw uno::RuntimeException("null returned from openStorageElement");
}
+#if OSL_DEBUG_LEVEL > 0
}
catch(const uno::Exception& )
{
- #if OSL_DEBUG_LEVEL > 0
Any aError( ::cppu::getCaughtException() );
SAL_WARN(
"basic",
"couldn't open sub storage for library \"" << Name
<< "\". Exception: "
<< comphelper::anyToString(aError));
- #endif
throw;
}
+#endif
}
Sequence< OUString > aNames = pImplLib->getElementNames();