summaryrefslogtreecommitdiffstats
path: root/stoc/source/servicemanager
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-27 09:11:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-27 11:02:56 +0200
commitcc1ed7fbce20f90650f96acc2846b6f232c8ab0f (patch)
treefcd441cdf9568861363894f63107967adf571f81 /stoc/source/servicemanager
parentFix typos (diff)
downloadcore-cc1ed7fbce20f90650f96acc2846b6f232c8ab0f.tar.gz
core-cc1ed7fbce20f90650f96acc2846b6f232c8ab0f.zip
loplugin:flatten in various
Change-Id: I42dca691ffadbddad38a7e8f978b1da9d5d9a7b0 Reviewed-on: https://gerrit.libreoffice.org/42842 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc/source/servicemanager')
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx39
1 files changed, 17 insertions, 22 deletions
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index a6d31551b7a1..6186ad209bf8 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -558,17 +558,16 @@ void SAL_CALL OServiceManagerWrapper::setPropertyValue(
if ( PropertyName == "DefaultContext" )
{
Reference< XComponentContext > xContext;
- if (aValue >>= xContext)
- {
- MutexGuard aGuard( m_mutex );
- m_xContext = xContext;
- }
- else
+ if (!(aValue >>= xContext))
{
throw IllegalArgumentException(
"no XComponentContext given!",
static_cast<OWeakObject *>(this), 1 );
}
+
+ MutexGuard aGuard( m_mutex );
+ m_xContext = xContext;
+
}
else
{
@@ -698,27 +697,23 @@ void OServiceManager::setPropertyValue(
const OUString& PropertyName, const Any& aValue )
{
check_undisposed();
- if ( PropertyName == "DefaultContext" )
- {
- Reference< XComponentContext > xContext;
- if (aValue >>= xContext)
- {
- MutexGuard aGuard( m_mutex );
- m_xContext = xContext;
- }
- else
- {
- throw IllegalArgumentException(
- "no XComponentContext given!",
- static_cast<OWeakObject *>(this), 1 );
- }
- }
- else
+ if ( PropertyName != "DefaultContext" )
{
throw UnknownPropertyException(
"unknown property " + PropertyName,
static_cast<OWeakObject *>(this) );
}
+
+ Reference< XComponentContext > xContext;
+ if (!(aValue >>= xContext))
+ {
+ throw IllegalArgumentException(
+ "no XComponentContext given!",
+ static_cast<OWeakObject *>(this), 1 );
+ }
+
+ MutexGuard aGuard( m_mutex );
+ m_xContext = xContext;
}
Any OServiceManager::getPropertyValue(const OUString& PropertyName)