diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-21 11:53:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 08:29:29 +0200 |
commit | 4af6c0948be47d7816eb1b6f2137b70aba639f0d (patch) | |
tree | 3965a1709f531229a6faaeef2e9d4026a30332b8 /framework/source/services | |
parent | 7b45044fd14661202c658923842dd629cf52961c (diff) |
loplugin:flatten in filter..i18npool
Change-Id: I9024b8b614a4de83a4d927e1918f6d4904a7fccb
Reviewed-on: https://gerrit.libreoffice.org/42592
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/services')
-rw-r--r-- | framework/source/services/ContextChangeEventMultiplexer.cxx | 5 | ||||
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 9 |
2 files changed, 5 insertions, 9 deletions
diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx b/framework/source/services/ContextChangeEventMultiplexer.cxx index ac579eeee802..59eca7c933a6 100644 --- a/framework/source/services/ContextChangeEventMultiplexer.cxx +++ b/framework/source/services/ContextChangeEventMultiplexer.cxx @@ -156,14 +156,13 @@ void SAL_CALL ContextChangeEventMultiplexer::addContextChangeEventListener ( if (pFocusDescriptor != nullptr) { ListenerContainer& rContainer (pFocusDescriptor->maListeners); - if (::std::find(rContainer.begin(), rContainer.end(), rxListener) == rContainer.end()) - rContainer.push_back(rxListener); - else + if (::std::find(rContainer.begin(), rContainer.end(), rxListener) != rContainer.end()) { // The listener was added for the same event focus // previously. That is an error. throw cssl::IllegalArgumentException("listener added twice", static_cast<XWeak*>(this), 0); } + rContainer.push_back(rxListener); } // Send out an initial event that informs the new listener about diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 44a17f6ac6b7..7aea555232a6 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -590,15 +590,12 @@ OUString const & SubstitutePathVariables::impl_getSubstituteVariableValue( const VarNameToIndexMap::const_iterator pNTOIIter = m_aPreDefVarMap.find( ( nPos == -1 ) ? aVariable : rVariable ); // Fixed/Predefined variable - if ( pNTOIIter != m_aPreDefVarMap.end() ) - { - PreDefVariable nIndex = pNTOIIter->second; - return m_aPreDefVars.m_FixedVar[(sal_Int32)nIndex]; - } - else + if ( pNTOIIter == m_aPreDefVarMap.end() ) { throw NoSuchElementException("Unknown variable!", static_cast<cppu::OWeakObject *>(this)); } + PreDefVariable nIndex = pNTOIIter->second; + return m_aPreDefVars.m_FixedVar[(sal_Int32)nIndex]; } void SubstitutePathVariables::SetPredefinedPathVariables() |