Kaydet (Commit) 3976f115 authored tarafından Muhammet Kara's avatar Muhammet Kara Kaydeden (comit) Noel Grandin

Add some exception messages to the removeSettings method

in UIConfigurationManager and ModuleUIConfigurationManager

Change-Id: I82c5369dc43dc8ccd9be62acaf327a39f3b4d68f
Reviewed-on: https://gerrit.libreoffice.org/41403Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst ebc11ae0
......@@ -1295,15 +1295,20 @@ void SAL_CALL ModuleUIConfigurationManager::removeSettings( const OUString& Reso
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
throw IllegalArgumentException();
throw IllegalArgumentException( "The ResourceURL is not valid or "
"describes an unknown type. "
"ResourceURL: " + ResourceURL, nullptr, 0 );
else if ( m_bReadOnly )
throw IllegalAccessException();
throw IllegalAccessException( "The configuration manager is read-only. "
"ResourceURL: " + ResourceURL, nullptr );
else
{
SolarMutexClearableGuard aGuard;
if ( m_bDisposed )
throw DisposedException();
throw DisposedException( "The configuration manager has been disposed, "
"and can't uphold its method specification anymore. "
"ResourceURL: " + ResourceURL, nullptr );
UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
if ( pDataSettings )
......@@ -1363,7 +1368,8 @@ void SAL_CALL ModuleUIConfigurationManager::removeSettings( const OUString& Reso
}
}
else
throw NoSuchElementException();
throw NoSuchElementException( "The settings data cannot be found. "
"ResourceURL: " + ResourceURL, nullptr );
}
}
......
......@@ -1005,15 +1005,20 @@ void SAL_CALL UIConfigurationManager::removeSettings( const OUString& ResourceUR
if (( nElementType == css::ui::UIElementType::UNKNOWN ) ||
( nElementType >= css::ui::UIElementType::COUNT ))
throw IllegalArgumentException();
throw IllegalArgumentException( "The ResourceURL is not valid or "
"describes an unknown type. "
"ResourceURL: " + ResourceURL, nullptr, 0 );
else if ( m_bReadOnly )
throw IllegalAccessException();
throw IllegalAccessException( "The configuration manager is read-only. "
"ResourceURL: " + ResourceURL, nullptr );
else
{
SolarMutexClearableGuard aGuard;
if ( m_bDisposed )
throw DisposedException();
throw DisposedException( "The configuration manager has been disposed, "
"and can't uphold its method specification anymore. "
"ResourceURL: " + ResourceURL, nullptr );
UIElementData* pDataSettings = impl_findUIElementData( ResourceURL, nElementType );
if ( pDataSettings )
......@@ -1052,7 +1057,8 @@ void SAL_CALL UIConfigurationManager::removeSettings( const OUString& ResourceUR
}
}
else
throw NoSuchElementException();
throw NoSuchElementException( "The settings data cannot be found. "
"ResourceURL: " + ResourceURL, nullptr);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment