diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 11:35:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-18 21:46:33 +0200 |
commit | 8d4fd3418322f3f6852054c44be2cd74b0db76ee (patch) | |
tree | 683729e0d4beabca34ac017c9d291ab2b21e3f7e /comphelper/source/officeinstdir | |
parent | ed0097845a07b6129f4e56cd28b90ce9b9368cf5 (diff) |
loplugin:flatten in comphelper
Change-Id: I1a8db4dbd744b87406d1db5609585495f01f4403
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92478
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source/officeinstdir')
-rw-r--r-- | comphelper/source/officeinstdir/officeinstallationdirectories.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index dec66895e940..b255fd3b9d44 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -208,30 +208,30 @@ OfficeInstallationDirectories::getSupportedServiceNames() void OfficeInstallationDirectories::initDirs() { - if ( !m_xOfficeBrandDir) - { - osl::MutexGuard aGuard( m_aMutex ); - if ( !m_xOfficeBrandDir ) - { - uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(m_xCtx); + if ( m_xOfficeBrandDir) + return; - m_xOfficeBrandDir = xExpander->expandMacros( "$BRAND_BASE_DIR" ); + osl::MutexGuard aGuard( m_aMutex ); + if ( m_xOfficeBrandDir ) + return; - OSL_ENSURE( !m_xOfficeBrandDir->isEmpty(), - "Unable to obtain office brand installation directory!" ); + uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(m_xCtx); - makeCanonicalFileURL( *m_xOfficeBrandDir ); + m_xOfficeBrandDir = xExpander->expandMacros( "$BRAND_BASE_DIR" ); - m_xUserDir = - xExpander->expandMacros( - "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ); + OSL_ENSURE( !m_xOfficeBrandDir->isEmpty(), + "Unable to obtain office brand installation directory!" ); - OSL_ENSURE( !m_xUserDir->isEmpty(), - "Unable to obtain office user data directory!" ); + makeCanonicalFileURL( *m_xOfficeBrandDir ); - makeCanonicalFileURL( *m_xUserDir ); - } - } + m_xUserDir = + xExpander->expandMacros( + "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ); + + OSL_ENSURE( !m_xUserDir->isEmpty(), + "Unable to obtain office user data directory!" ); + + makeCanonicalFileURL( *m_xUserDir ); } } |