diff options
author | Oliver Bolte <obo@openoffice.org> | 2009-02-17 12:51:38 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2009-02-17 12:51:38 +0000 |
commit | df0dd23be65a9c1c43be151d243ab95fd76c836b (patch) | |
tree | 16c210756108ddb3344e2d573ee12f22e5b37915 /configmgr | |
parent | 83c5f27a85e57132980c8d4f3d1687089a1eddfe (diff) |
CWS-TOOLING: integrate CWS sb105
2009-02-02 15:33:54 +0100 sb r267272 : #i98602# childNode apparently can legitimately be null in handle(ValueNode const &); this was asserted---but otherwise handled gracefully---before r262819
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/tree/updatehelper.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/configmgr/source/tree/updatehelper.cxx b/configmgr/source/tree/updatehelper.cxx index bf0a65d9e412..5d07d3289e3d 100644 --- a/configmgr/source/tree/updatehelper.cxx +++ b/configmgr/source/tree/updatehelper.cxx @@ -450,36 +450,36 @@ void ApplyUpdate::handle(RemoveNode& _rChange) virtual void handle(ValueNode const& _aNewNode) { sharable::Node * childNode = m_cacheNode->getSubnode(getNodeName(_aNewNode)); - - OSL_ENSURE(childNode != 0, "TreeDifferenceBuilder: could not find expected node !"); - - sharable::ValueNode * valueNode = childNode->valueData(); - - OSL_ENSURE(valueNode != 0, "TreeDifferenceBuilder: node must be a value node!"); - - // if the values differ add a new change - if (_aNewNode.getValue() != valueNode->getValue()) + if (childNode != 0) { - bool bNewDefault = _aNewNode.isDefault(); - bool bOldDefault = valueNode->info.isDefault(); - - ValueChange::Mode eMode; - if (bNewDefault) - if (bOldDefault) - eMode = ValueChange::changeDefault; - else - eMode = ValueChange::setToDefault; - else - if (bOldDefault) - eMode = ValueChange::wasDefault; + sharable::ValueNode * valueNode = childNode->valueData(); + + OSL_ENSURE(valueNode != 0, "TreeDifferenceBuilder: node must be a value node!"); + + // if the values differ add a new change + if (_aNewNode.getValue() != valueNode->getValue()) + { + bool bNewDefault = _aNewNode.isDefault(); + bool bOldDefault = valueNode->info.isDefault(); + + ValueChange::Mode eMode; + if (bNewDefault) + if (bOldDefault) + eMode = ValueChange::changeDefault; + else + eMode = ValueChange::setToDefault; else - eMode = ValueChange::changeValue; + if (bOldDefault) + eMode = ValueChange::wasDefault; + else + eMode = ValueChange::changeValue; - std::auto_ptr<Change> pChange( - new ValueChange(_aNewNode.getName(), _aNewNode.getAttributes(), eMode, - _aNewNode.getValue(), valueNode->getValue()) ); + std::auto_ptr<Change> pChange( + new ValueChange(_aNewNode.getName(), _aNewNode.getAttributes(), eMode, + _aNewNode.getValue(), valueNode->getValue()) ); - m_rChangeList.addChange(pChange); + m_rChangeList.addChange(pChange); + } } } virtual void handle(ISubtree const& _aNewNode) |