mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-30 08:38:15 +01:00
recalculate value if child nodes are fiddled with
This commit is contained in:
parent
a71a89e918
commit
6c749609c0
1 changed files with 39 additions and 9 deletions
|
@ -75,6 +75,36 @@ class AttrImpl : public DOM::Attr_impl<stringT, string_adaptorT>,
|
|||
virtual DOMNode_implT* getPreviousSibling() const { return 0; }
|
||||
virtual DOMNode_implT* getNextSibling() const { return 0; }
|
||||
|
||||
virtual DOMNode_implT* insertBefore(DOMNode_implT* newChild, DOMNode_implT* refChild)
|
||||
{
|
||||
valueCalculated_ = false;
|
||||
return NodeT::insertBefore(newChild, refChild);
|
||||
} // insertBefore
|
||||
|
||||
virtual DOMNode_implT* replaceChild(DOMNode_implT* newChild, DOMNode_implT* oldChild)
|
||||
{
|
||||
valueCalculated_ = false;
|
||||
return NodeT::replaceChild(newChild, oldChild);
|
||||
} // replaceChild
|
||||
|
||||
virtual DOMNode_implT* removeChild(DOMNode_implT* oldChild)
|
||||
{
|
||||
valueCalculated_ = false;
|
||||
return NodeT::removeChild(oldChild);
|
||||
} // removeChild
|
||||
|
||||
virtual DOMNode_implT* appendChild(DOMNode_implT* newChild)
|
||||
{
|
||||
valueCalculated_ = false;
|
||||
return NodeT::appendChild(newChild);
|
||||
} // appendChild
|
||||
|
||||
virtual void purgeChild(DOMNode_implT* oldChild)
|
||||
{
|
||||
valueCalculated_ = false;
|
||||
NodeT::purgeChild(oldChild);
|
||||
} // purgeChild
|
||||
|
||||
virtual DOMNode_implT* cloneNode(bool /*deep*/) const
|
||||
{
|
||||
AttrImpl* a = dynamic_cast<AttrImpl*>(NodeT::ownerDoc_->createAttribute(*name_));
|
||||
|
@ -107,7 +137,7 @@ class AttrImpl : public DOM::Attr_impl<stringT, string_adaptorT>,
|
|||
NodeT::removeChild(c);
|
||||
|
||||
// add a new text node
|
||||
NodeT::appendChild(new TextImpl<stringT, string_adaptorT>(0, data));
|
||||
NodeT::appendChild(NodeT::ownerDoc_->createTextNode(data));
|
||||
|
||||
valueCalculated_ = false;
|
||||
specified_ = true;
|
||||
|
@ -173,7 +203,7 @@ class AttrImpl : public DOM::Attr_impl<stringT, string_adaptorT>,
|
|||
bool specified_;
|
||||
mutable bool valueCalculated_;
|
||||
mutable stringT value_;
|
||||
}; // class CDATAImpl
|
||||
}; // class AttrImpl
|
||||
|
||||
} // namespace SimpleDOM
|
||||
} // namespace Arabica
|
||||
|
|
Loading…
Add table
Reference in a new issue