@@ -951,11 +951,6 @@ namespace ModelInstance
951951 mRestriction = mModelJson .value (" restriction" ).toString ();
952952 }
953953
954- // short type definitions have modifiers
955- if (mModelJson .contains (" modifiers" )) {
956- mModifier .deserialize (mModelJson .value (" modifiers" ));
957- }
958-
959954 if (mModelJson .contains (" prefixes" )) {
960955 mpPrefixes->deserialize (mModelJson .value (" prefixes" ).toObject ());
961956 }
@@ -1409,15 +1404,12 @@ namespace ModelInstance
14091404 QString Element::getModifierValueFromType (QStringList modifierNames)
14101405 {
14111406 /* 1. First check if unit is defined with in the component modifier.
1412- * 2. If no unit is found then check it in the derived class modifier value.
1413- * 3. A derived class can be inherited, so look recursively.
1407+ * 2. If no unit is found then check it in the derived class modifier value recursively.
14141408 */
14151409 // Case 1
14161410 QString modifierValue = mModifier .getModifierValue (modifierNames);
14171411 if (modifierValue.isEmpty () && mpModel) {
14181412 // Case 2
1419- modifierValue = mpModel->getModifier ().getModifierValue (modifierNames);
1420- // Case 3
14211413 if (modifierValue.isEmpty ()) {
14221414 modifierValue = Element::getModifierValueFromInheritedType (mpModel, modifierNames);
14231415 }
@@ -1459,10 +1451,10 @@ namespace ModelInstance
14591451 {
14601452 QString modifierValue = " " ;
14611453 foreach (auto pElement, pModel->getElements ()) {
1462- if (pElement->isExtend () && pElement-> getModel () ) {
1454+ if (pElement->isExtend ()) {
14631455 auto pExtend = dynamic_cast <Extend*>(pElement);
1464- modifierValue = pExtend->getModel ()-> getModifier ().getModifierValue (modifierNames);
1465- if (modifierValue.isEmpty ()) {
1456+ modifierValue = pExtend->getModifier ().getModifierValue (modifierNames);
1457+ if (modifierValue.isEmpty () && pExtend-> getModel () ) {
14661458 modifierValue = Element::getModifierValueFromInheritedType (pExtend->getModel (), modifierNames);
14671459 } else {
14681460 return modifierValue;
0 commit comments