diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2015-10-12 19:53:08 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2015-10-12 19:53:08 (GMT) |
commit | 5a266095ee778fb700c067c55ff0b59777a72c50 (patch) | |
tree | 5b714661965f0787330de044fc4e196f4b54b90f /Source/CPack/WiX/cmWIXPatch.cxx | |
parent | e5fb30fb5bdff2913cc9382649984da89e882b25 (diff) | |
download | CMake-5a266095ee778fb700c067c55ff0b59777a72c50.zip CMake-5a266095ee778fb700c067c55ff0b59777a72c50.tar.gz CMake-5a266095ee778fb700c067c55ff0b59777a72c50.tar.bz2 |
CPackWIX: Handle text nodes in XML patch content
Diffstat (limited to 'Source/CPack/WiX/cmWIXPatch.cxx')
-rw-r--r-- | Source/CPack/WiX/cmWIXPatch.cxx | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx index 5a8dc63..471c3a4 100644 --- a/Source/CPack/WiX/cmWIXPatch.cxx +++ b/Source/CPack/WiX/cmWIXPatch.cxx @@ -33,13 +33,30 @@ void cmWIXPatch::ApplyFragment( if(i == Fragments.end()) return; const cmWIXPatchElement& fragment = i->second; + + this->ApplyElementChildren(fragment, writer); + + Fragments.erase(i); +} + +void cmWIXPatch::ApplyElementChildren( + const cmWIXPatchElement& element, cmWIXSourceWriter& writer) +{ for(cmWIXPatchElement::child_list_t::const_iterator - j = fragment.children.begin(); j != fragment.children.end(); ++j) + j = element.children.begin(); j != element.children.end(); ++j) + { + cmWIXPatchNode *node = *j; + + switch(node->type()) { - ApplyElement(**j, writer); + case cmWIXPatchNode::ELEMENT: + ApplyElement(dynamic_cast<const cmWIXPatchElement&>(*node), writer); + break; + case cmWIXPatchNode::TEXT: + writer.AddTextNode(dynamic_cast<const cmWIXPatchText&>(*node).text); + break; } - - Fragments.erase(i); + } } void cmWIXPatch::ApplyElement( @@ -53,16 +70,11 @@ void cmWIXPatch::ApplyElement( writer.AddAttribute(i->first, i->second); } - for(cmWIXPatchElement::child_list_t::const_iterator - i = element.children.begin(); i != element.children.end(); ++i) - { - ApplyElement(**i, writer); - } + this->ApplyElementChildren(element, writer); writer.EndElement(element.name); } - bool cmWIXPatch::CheckForUnappliedFragments() { std::string fragmentList; |