diff options
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; |