From 325079906abc6e4814264bc874ca19f157f48e92 Mon Sep 17 00:00:00 2001 From: srn Date: Fri, 23 Nov 2007 15:02:12 +0000 Subject: [PATCH] Added calls of virtual callback methods of DF_Attribute on attribute addiotion: AfterAddition and on forget: BeforeForget --- src/DF/DF_Label.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/DF/DF_Label.cxx b/src/DF/DF_Label.cxx index 453630a3f..08d8ae9f8 100644 --- a/src/DF/DF_Label.cxx +++ b/src/DF/DF_Label.cxx @@ -145,6 +145,7 @@ bool DF_Label::AddAttribute(DF_Attribute* theAttribute) const if(_node->_attributes.find(theAttribute->ID()) != _node->_attributes.end()) return false; theAttribute->_node = _node; _node->_attributes[theAttribute->ID()] = theAttribute; + theAttribute->AfterAddition(); return true; } @@ -156,6 +157,7 @@ bool DF_Label::ForgetAttribute(const std::string& theID) const if(_node->_attributes.find(theID) == _node->_attributes.end()) return false; DF_Attribute* attr = _node->_attributes[theID]; + attr->BeforeForget(); _node->_attributes.erase(theID); delete attr; @@ -170,8 +172,10 @@ bool DF_Label::ForgetAllAttributes(bool clearChildren) const vector va = GetAttributes(); _node->_attributes.clear(); - for(int i = 0, len = va.size(); iBeforeForget(); delete va[i]; + } if(clearChildren) { DF_ChildIterator CI(*this, true); -- 2.39.2