void nodeRemoveChild(struct Node* parent, struct Node* child) {
    child->parent = 0;
    if (child->prev) {
        child->prev->next = child->next;
    } else {
        parent->firstChild = child->next;
    }
    if (child->next) {
        child->next->prev = child->prev;
    } else {
        parent->lastChild = child->prev;
    }

    removeChildElement(&parent->element, &child->element);
}
Пример #2
0
		void nodeRemoveChild(struct Node* parent, struct Node* child)
		{
			if (child->parent != parent) {
				return;
			}

			child->parent = nullptr;
			if (child->prev) {
				child->prev->next = child->next;
			} else {
				parent->firstChild = child->next;
			}
			if (child->next) {
				child->next->prev = child->prev;
			} else {
				parent->lastChild = child->prev;
			}

			child->next = nullptr;

			removeChildElement(&parent->element, &child->element);
		}