assert if a model is used in duplicate widgets

we never do this deliberately

Change-Id: I6d6d8ea13fb5f09bcf631c0474e671d4605f4c69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135427
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2022-06-04 16:59:09 +01:00
parent 3cca2c6053
commit 264b78cbd7

View file

@ -544,9 +544,13 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const OUString& sUIDir, const OUStr
}
}
#ifndef NDEBUG
o3tl::sorted_vector<OUString> models;
#endif
//Set ComboBox models when everything has been imported
for (auto const& elem : m_pParserState->m_aModelMaps)
{
assert(models.insert(elem.m_sValue).second && "a liststore or treestore is used in duplicate widgets");
vcl::Window* pTarget = get(elem.m_sID);
ListBox *pListBoxTarget = dynamic_cast<ListBox*>(pTarget);
ComboBox *pComboBoxTarget = dynamic_cast<ComboBox*>(pTarget);