tdf#42982 Use IllegalTypeException Error with message
within impl_initValues_throw
Change-Id: I03942ac2e3478e57b7d94b77b6f100367a53f7ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166648
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index 8719267..cc82782 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -369,9 +369,9 @@ namespace comphelper
void EnumerableMap::impl_initValues_throw( const Sequence< Pair< Any, Any > >& _initialValues )
{
OSL_PRECOND( m_aData.m_pValues && m_aData.m_pValues->empty(), "EnumerableMap::impl_initValues_throw: illegal call!" );
if (!m_aData.m_pValues || !m_aData.m_pValues->empty())
throw RuntimeException();
if (!m_aData.m_pValues || !m_aData.m_pValues->empty()){
throw IllegalTypeException("EnumerableMap m_aData container is invalid or not empty.", *this);
}
for (auto& mapping : _initialValues)
{
impl_checkValue_throw(mapping.Second);