summaryrefslogtreecommitdiff
path: root/framework/source/services
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/services')
-rw-r--r--framework/source/services/ContextChangeEventMultiplexer.cxx5
-rw-r--r--framework/source/services/substitutepathvars.cxx9
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()