diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-09-25 00:08:38 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-09-25 00:08:38 +0100 |
commit | c16d0afab555bf1fc8db82be391bdd61dfffc919 (patch) | |
tree | 2cdcfe648ac046a8f3eaf55093e848133c96477b | |
parent | Support for custom model parts (diff) | |
download | slicer-c16d0afab555bf1fc8db82be391bdd61dfffc919.tar.bz2 slicer-c16d0afab555bf1fc8db82be391bdd61dfffc919.tar.xz slicer-c16d0afab555bf1fc8db82be391bdd61dfffc919.zip |
Only write simple models as text
-rw-r--r-- | slicer/xml/serializer.cpp | 8 |
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 |