diff options
author | sb <sb@openoffice.org> | 2010-05-11 09:29:37 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-05-11 09:29:37 +0200 |
commit | c593c31aa9865baef540da5732fb425dd32b9b03 (patch) | |
tree | f584d8c9b2bad2ed42db34256cad3a00e4b6b866 /configmgr/source/setnode.cxx | |
parent | 8faf3781aa21c8bd95449eda6958b7be086b5e75 (diff) |
sb122: #i111492# node-ref clone must not copy templateName_
Diffstat (limited to 'configmgr/source/setnode.cxx')
-rw-r--r-- | configmgr/source/setnode.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx index f19c36c0bba5..465345a5f856 100644 --- a/configmgr/source/setnode.cxx +++ b/configmgr/source/setnode.cxx @@ -69,8 +69,8 @@ SetNode::SetNode( templateName_(templateName), mandatory_(Data::NO_LAYER) {} -rtl::Reference< Node > SetNode::clone() const { - return new SetNode(*this); +rtl::Reference< Node > SetNode::clone(bool keepTemplateName) const { + return new SetNode(*this, keepTemplateName); } NodeMap & SetNode::getMembers() { @@ -105,12 +105,15 @@ bool SetNode::isValidTemplate(rtl::OUString const & templateName) const { additionalTemplateNames_.end()); } -SetNode::SetNode(SetNode const & other): +SetNode::SetNode(SetNode const & other, bool keepTemplateName): Node(other), defaultTemplateName_(other.defaultTemplateName_), additionalTemplateNames_(other.additionalTemplateNames_), - templateName_(other.templateName_), mandatory_(other.mandatory_) + mandatory_(other.mandatory_) { cloneNodeMap(other.members_, &members_); + if (keepTemplateName) { + templateName_ = other.templateName_; + } } SetNode::~SetNode() {} |