diff options
Diffstat (limited to 'configmgr/source/xcuparser.cxx')
-rw-r--r-- | configmgr/source/xcuparser.cxx | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 764cf8ce36f3..b05fe0e7e3c5 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -218,6 +218,9 @@ bool XcuParser::startElement( css::uno::Reference< css::uno::XInterface >()); } break; + case Node::KIND_ROOT: + assert(false); // this cannot happen + break; } } return true; @@ -239,7 +242,9 @@ void XcuParser::endElement(xmlreader::XmlReader const &) { state_.pop(); if (insert.is()) { assert(!state_.empty() && state_.top().node.is()); - state_.top().node->getMembers()[name] = insert; + NodeMap * members = state_.top().node->getMemberMap(); + assert(members != 0); + (*members)[name] = insert; } if (pop && !path_.empty()) { path_.pop_back(); @@ -590,9 +595,10 @@ void XcuParser::handleLocpropValue( return; } } - NodeMap::iterator i(locprop->getMembers().find(name)); - if (i != locprop->getMembers().end() && - i->second->getLayer() > valueParser_.getLayer()) + NodeMap * members = locprop->getMemberMap(); + assert(members != 0); + NodeMap::iterator i(members->find(name)); + if (i != members->end() && i->second->getLayer() > valueParser_.getLayer()) { state_.push(State(true)); // ignored return; @@ -610,8 +616,8 @@ void XcuParser::handleLocpropValue( { bool pop = false; if (nil) { - if (i == locprop->getMembers().end()) { - locprop->getMembers()[name] = new LocalizedValueNode( + if (i == members->end()) { + (*members)[name] = new LocalizedValueNode( valueParser_.getLayer(), css::uno::Any()); } else { dynamic_cast< LocalizedValueNode * >( @@ -635,8 +641,8 @@ void XcuParser::handleLocpropValue( case OPERATION_REMOVE: //TODO: only allow if parent.op == OPERATION_FUSE //TODO: disallow removing when e.g. lang=""? - if (i != locprop->getMembers().end()) { - locprop->getMembers().erase(i); + if (i != members->end()) { + members->erase(i); } state_.push(State(true)); recordModification(false); @@ -702,8 +708,10 @@ void XcuParser::handleGroupProp( return; } } - NodeMap::iterator i(group->getMembers().find(name)); - if (i == group->getMembers().end()) { + NodeMap * members = group->getMemberMap(); + assert(members != 0); + NodeMap::iterator i(members->find(name)); + if (i == members->end()) { handleUnknownGroupProp(reader, group, name, type, op, finalized); } else { switch (i->second->kind()) { @@ -814,7 +822,9 @@ void XcuParser::handlePlainGroupProp( reader.getUrl()), css::uno::Reference< css::uno::XInterface >()); } - group->getMembers().erase(propertyIndex); + NodeMap * members = group->getMemberMap(); + assert(members != 0); + members->erase(propertyIndex); state_.push(State(true)); // ignore children recordModification(false); break; @@ -1035,8 +1045,10 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { } int finalizedLayer = finalized ? valueParser_.getLayer() : Data::NO_LAYER; int mandatoryLayer = mandatory ? valueParser_.getLayer() : Data::NO_LAYER; - NodeMap::iterator i(set->getMembers().find(name)); - if (i != set->getMembers().end()) { + NodeMap * members = set->getMemberMap(); + assert(members != 0); + NodeMap::iterator i(members->find(name)); + if (i != members->end()) { finalizedLayer = std::min(finalizedLayer, i->second->getFinalized()); i->second->setFinalized(finalizedLayer); mandatoryLayer = std::min(mandatoryLayer, i->second->getMandatory()); @@ -1048,7 +1060,7 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { } switch (op) { case OPERATION_MODIFY: - if (i == set->getMembers().end()) { + if (i == members->end()) { SAL_WARN( "configmgr", "ignoring modify of unknown set member node \"" << name @@ -1071,11 +1083,11 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { member->setFinalized(finalizedLayer); member->setMandatory(mandatoryLayer); state_.push(State(member, name, false)); - recordModification(i == set->getMembers().end()); + recordModification(i == members->end()); } break; case OPERATION_FUSE: - if (i == set->getMembers().end()) { + if (i == members->end()) { if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) { state_.push(State(true)); // ignored @@ -1102,13 +1114,13 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { // forget about user-layer removals that no longer remove anything // (so that paired additions/removals in the user layer do not grow // registrymodifications.xcu unbounded): - bool known = i != set->getMembers().end(); + bool known = i != members->end(); if (known && !state_.top().locked && finalizedLayer >= valueParser_.getLayer() && (mandatoryLayer == Data::NO_LAYER || mandatoryLayer > valueParser_.getLayer())) { - set->getMembers().erase(i); + members->erase(i); } state_.push(State(true)); if (known) { |