Mapper comitting finished

This commit is contained in:
Jakub Melka 2020-11-30 18:46:15 +01:00
parent 3e2f351c0e
commit a35504198d
1 changed files with 17 additions and 1 deletions

View File

@ -182,8 +182,24 @@ void PDFObjectEditorWidgetMapper::onCommitRequested(size_t attribute)
}
// Step 4)
s
for (size_t i = 0; i < m_model->getAttributeCount(); ++i)
{
if (!m_model->queryAttribute(i, PDFObjectEditorAbstractModel::Question::IsPersisted))
{
continue;
}
if (!m_model->queryAttribute(i, PDFObjectEditorAbstractModel::Question::HasAttribute))
{
object = m_model->writeAttributeValueToObject(dependentAttribute, object, PDFObject());
}
else if (m_model->getAttributeType(i) == ObjectEditorAttributeType::Constant)
{
object = m_model->writeAttributeValueToObject(dependentAttribute, object, m_model->getDefaultValue(i));
}
}
// Step 5)
m_model->setEditedObject(object);
loadWidgets();