diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-12-13 22:16:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-12-13 22:16:31 +0100 |
commit | db4bc6812d69d960a558b89c18f08b17a2e38d27 (patch) | |
tree | 15d6547e929635baaffd9a4008a872e9d1c246e6 /configmgr/source/xcsparser.cxx | |
parent | 39cbce553da1834f78b77f48b2f1be9578d6cc05 (diff) |
Unified configmgr::Node::getMember{s,Map} again.
(With the insight that Data::components is RootNode::members.)
Diffstat (limited to 'configmgr/source/xcsparser.cxx')
-rw-r--r-- | configmgr/source/xcsparser.cxx | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 66f3f2891713..ed83d3582b5b 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -82,15 +82,14 @@ void merge( for (NodeMap::const_iterator i2(update->getMembers().begin()); i2 != update->getMembers().end(); ++i2) { - NodeMap * members = original->getMemberMap(); - assert(members != 0); - NodeMap::iterator i1(members->find(i2->first)); - if (i1 == members->end()) { + NodeMap & members = original->getMembers(); + NodeMap::iterator i1(members.find(i2->first)); + if (i1 == members.end()) { if (i2->second->kind() == Node::KIND_PROPERTY && dynamic_cast< GroupNode * >( original.get())->isExtensible()) { - members->insert(*i2); + members.insert(*i2); } } else if (i2->second->kind() == i1->second->kind()) { merge(i1->second, i2->second); @@ -101,14 +100,13 @@ void merge( for (NodeMap::const_iterator i2(update->getMembers().begin()); i2 != update->getMembers().end(); ++i2) { - NodeMap * members = original->getMemberMap(); - assert(members != 0); - NodeMap::iterator i1(members->find(i2->first)); - if (i1 == members->end()) { + NodeMap & members = original->getMembers(); + NodeMap::iterator i1(members.find(i2->first)); + if (i1 == members.end()) { if (dynamic_cast< SetNode * >(original.get())-> isValidTemplate(i2->second->getTemplateName())) { - members->insert(*i2); + members.insert(*i2); } } else if (i2->second->kind() == i1->second->kind() && (i2->second->getTemplateName() == @@ -298,9 +296,10 @@ void XcsParser::endElement(xmlreader::XmlReader const & reader) { break; case STATE_COMPONENT: { - NodeMap::iterator i(data_.components.find(top.name)); - if (i == data_.components.end()) { - data_.components.insert( + NodeMap & components = data_.getComponents(); + NodeMap::iterator i(components.find(top.name)); + if (i == components.end()) { + components.insert( NodeMap::value_type(top.name, top.node)); } else { merge(i->second, top.node); @@ -316,10 +315,8 @@ void XcsParser::endElement(xmlreader::XmlReader const & reader) { css::uno::Reference< css::uno::XInterface >()); } } else { - NodeMap * members = elements_.top().node->getMemberMap(); - assert(members != 0); - if (!members->insert(NodeMap::value_type(top.name, top.node)). - second) + if (!elements_.top().node->getMembers().insert( + NodeMap::value_type(top.name, top.node)).second) { throw css::uno::RuntimeException( (rtl::OUString( |