Skip to content

Commit 2900a39

Browse files
authored
Handle the constrainedby when doing copy paste (#13330)
Fixes #13300
1 parent e91d746 commit 2900a39

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

OMEdit/OMEditLIB/Modeling/Model.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2276,10 +2276,21 @@ namespace ModelInstance
22762276
if (!dims.isEmpty()) {
22772277
value.append("[" % dims % "]");
22782278
}
2279+
// modifiers
22792280
if (mpModifier) {
22802281
value.append(mpModifier->toString());
22812282
}
2282-
if (!mComment.isEmpty()) {
2283+
// constrainedby issue #13300
2284+
if (mpPrefixes && mpPrefixes->getReplaceable() && !mpPrefixes->getReplaceable()->getConstrainedby().isEmpty()) {
2285+
value.append("constrainedby " % mpPrefixes->getReplaceable()->getConstrainedby());
2286+
if (mpPrefixes->getReplaceable()->getModifier()) {
2287+
value.append(mpPrefixes->getReplaceable()->getModifier()->toString());
2288+
}
2289+
}
2290+
// comment
2291+
if (mpPrefixes && mpPrefixes->getReplaceable() && !mpPrefixes->getReplaceable()->getComment().isEmpty()) {
2292+
value.append("\"" % mpPrefixes->getReplaceable()->getComment() % "\"");
2293+
} else if (!mComment.isEmpty()) {
22832294
value.append("\"" % mComment % "\"");
22842295
}
22852296

0 commit comments

Comments
 (0)