summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-09-25 00:08:38 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-09-25 00:08:38 +0100
commitc16d0afab555bf1fc8db82be391bdd61dfffc919 (patch)
tree2cdcfe648ac046a8f3eaf55093e848133c96477b
parentSupport for custom model parts (diff)
downloadslicer-c16d0afab555bf1fc8db82be391bdd61dfffc919.tar.bz2
slicer-c16d0afab555bf1fc8db82be391bdd61dfffc919.tar.xz
slicer-c16d0afab555bf1fc8db82be391bdd61dfffc919.zip
Only write simple models as text
-rw-r--r--slicer/xml/serializer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp
index c1e4023..9df87b8 100644
--- a/slicer/xml/serializer.cpp
+++ b/slicer/xml/serializer.cpp
@@ -265,8 +265,12 @@ namespace Slicer {
element->set_attribute(*typeIdPropName, *typeId);
mp = mp->GetSubclassModelPart(*typeId);
}
- mp->GetValue(new XmlContentValueTarget(element));
- mp->OnEachChild(boost::bind(&XmlSerializer::ModelTreeIterate, element, _1, _2, _3, ec));
+ if (mp->GetType() == mpt_Simple) {
+ mp->GetValue(new XmlContentValueTarget(element));
+ }
+ else {
+ mp->OnEachChild(boost::bind(&XmlSerializer::ModelTreeIterate, element, _1, _2, _3, ec));
+ }
}
void