summaryrefslogtreecommitdiff
path: root/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx')
-rw-r--r--framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx88
1 files changed, 40 insertions, 48 deletions
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index 403e045c99f8..fcde32765a42 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -1128,17 +1128,15 @@ sal_Bool SAL_CALL ModuleUIConfigurationManager::hasSettings( const OUString& Res
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
throw IllegalArgumentException();
- else
- {
- SolarMutexGuard g;
- if ( m_bDisposed )
- throw DisposedException();
+ SolarMutexGuard g;
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
- if ( pDataSettings )
- return true;
- }
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
+ if ( pDataSettings )
+ return true;
return false;
}
@@ -1150,22 +1148,20 @@ Reference< XIndexAccess > SAL_CALL ModuleUIConfigurationManager::getSettings( co
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
throw IllegalArgumentException();
- else
- {
- SolarMutexGuard g;
- if ( m_bDisposed )
- throw DisposedException();
+ SolarMutexGuard g;
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
- if ( pDataSettings )
- {
- // Create a copy of our data if someone wants to change the data.
- if ( bWriteable )
- return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( pDataSettings->xSettings ) ), UNO_QUERY );
- else
- return pDataSettings->xSettings;
- }
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
+ if ( pDataSettings )
+ {
+ // Create a copy of our data if someone wants to change the data.
+ if ( bWriteable )
+ return Reference< XIndexAccess >( static_cast< OWeakObject * >( new RootItemContainer( pDataSettings->xSettings ) ), UNO_QUERY );
+ else
+ return pDataSettings->xSettings;
}
throw NoSuchElementException();
@@ -1474,17 +1470,15 @@ sal_Bool SAL_CALL ModuleUIConfigurationManager::isDefaultSettings( const OUStrin
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
throw IllegalArgumentException();
- else
- {
- SolarMutexGuard g;
- if ( m_bDisposed )
- throw DisposedException();
+ SolarMutexGuard g;
- UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
- if ( pDataSettings && pDataSettings->bDefaultNode )
- return true;
- }
+ if ( m_bDisposed )
+ throw DisposedException();
+
+ UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType, false );
+ if ( pDataSettings && pDataSettings->bDefaultNode )
+ return true;
return false;
}
@@ -1496,25 +1490,23 @@ Reference< XIndexAccess > SAL_CALL ModuleUIConfigurationManager::getDefaultSetti
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
throw IllegalArgumentException();
- else
- {
- SolarMutexGuard g;
- if ( m_bDisposed )
- throw DisposedException();
+ SolarMutexGuard g;
- // preload list of element types on demand
- impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
+ if ( m_bDisposed )
+ throw DisposedException();
- // Look into our default vector/unordered_map combination
- UIElementDataHashMap& rDefaultHashMap = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
- UIElementDataHashMap::iterator pIter = rDefaultHashMap.find( ResourceURL );
- if ( pIter != rDefaultHashMap.end() )
- {
- if ( !pIter->second.xSettings.is() )
- impl_requestUIElementData( nElementType, LAYER_DEFAULT, pIter->second );
- return pIter->second.xSettings;
- }
+ // preload list of element types on demand
+ impl_preloadUIElementTypeList( LAYER_DEFAULT, nElementType );
+
+ // Look into our default vector/unordered_map combination
+ UIElementDataHashMap& rDefaultHashMap = m_aUIElements[LAYER_DEFAULT][nElementType].aElementsHashMap;
+ UIElementDataHashMap::iterator pIter = rDefaultHashMap.find( ResourceURL );
+ if ( pIter != rDefaultHashMap.end() )
+ {
+ if ( !pIter->second.xSettings.is() )
+ impl_requestUIElementData( nElementType, LAYER_DEFAULT, pIter->second );
+ return pIter->second.xSettings;
}
// Nothing has been found!