Lines 79-84
Link Here
|
79 |
kdDebug( 6040 ) << this << ": " << renderName() << "(RenderObject)::addChild( " << newChild << ": " << |
79 |
kdDebug( 6040 ) << this << ": " << renderName() << "(RenderObject)::addChild( " << newChild << ": " << |
80 |
newChild->renderName() << ", " << (beforeChild ? beforeChild->renderName() : "0") << " )" << endl; |
80 |
newChild->renderName() << ", " << (beforeChild ? beforeChild->renderName() : "0") << " )" << endl; |
81 |
#endif |
81 |
#endif |
|
|
82 |
// protect ourselves from deletion |
83 |
setDoNotDelete(true); |
82 |
|
84 |
|
83 |
bool needsTable = false; |
85 |
bool needsTable = false; |
84 |
|
86 |
|
Lines 159-164
Link Here
|
159 |
static_cast<RenderText*>(newChild)->setText(textToTransform, true); |
161 |
static_cast<RenderText*>(newChild)->setText(textToTransform, true); |
160 |
} |
162 |
} |
161 |
newChild->attach(); |
163 |
newChild->attach(); |
|
|
164 |
|
165 |
setDoNotDelete(false); |
162 |
} |
166 |
} |
163 |
|
167 |
|
164 |
RenderObject* RenderContainer::removeChildNode(RenderObject* oldChild) |
168 |
RenderObject* RenderContainer::removeChildNode(RenderObject* oldChild) |
Lines 545-551
Link Here
|
545 |
RenderObject *next = child->nextSibling(); |
549 |
RenderObject *next = child->nextSibling(); |
546 |
|
550 |
|
547 |
if ( child->isRenderBlock() && child->isAnonymousBlock() && !child->continuation() && |
551 |
if ( child->isRenderBlock() && child->isAnonymousBlock() && !child->continuation() && |
548 |
!child->childrenInline() && !child->isTableCell() ) { |
552 |
!child->childrenInline() && !child->isTableCell() && !child->doNotDelete()) { |
549 |
RenderObject *firstAnChild = child->firstChild(); |
553 |
RenderObject *firstAnChild = child->firstChild(); |
550 |
RenderObject *lastAnChild = child->lastChild(); |
554 |
RenderObject *lastAnChild = child->lastChild(); |
551 |
if ( firstAnChild ) { |
555 |
if ( firstAnChild ) { |
Lines 560-576
Link Here
|
560 |
child->previousSibling()->setNextSibling( firstAnChild ); |
564 |
child->previousSibling()->setNextSibling( firstAnChild ); |
561 |
if ( child->nextSibling() ) |
565 |
if ( child->nextSibling() ) |
562 |
child->nextSibling()->setPreviousSibling( lastAnChild ); |
566 |
child->nextSibling()->setPreviousSibling( lastAnChild ); |
|
|
567 |
if ( child == firstChild() ) |
568 |
m_first = firstAnChild; |
569 |
if ( child == lastChild() ) |
570 |
m_last = lastAnChild; |
563 |
} else { |
571 |
} else { |
564 |
if ( child->previousSibling() ) |
572 |
if ( child->previousSibling() ) |
565 |
child->previousSibling()->setNextSibling( child->nextSibling() ); |
573 |
child->previousSibling()->setNextSibling( child->nextSibling() ); |
566 |
if ( child->nextSibling() ) |
574 |
if ( child->nextSibling() ) |
567 |
child->nextSibling()->setPreviousSibling( child->previousSibling() ); |
575 |
child->nextSibling()->setPreviousSibling( child->previousSibling() ); |
568 |
|
|
|
569 |
} |
570 |
if ( child == firstChild() ) |
576 |
if ( child == firstChild() ) |
571 |
m_first = firstAnChild; |
577 |
m_first = child->nextSibling(); |
572 |
if ( child == lastChild() ) |
578 |
if ( child == lastChild() ) |
573 |
m_last = lastAnChild; |
579 |
m_last = child->previousSibling(); |
|
|
580 |
} |
581 |
|
574 |
child->setParent( 0 ); |
582 |
child->setParent( 0 ); |
575 |
child->setPreviousSibling( 0 ); |
583 |
child->setPreviousSibling( 0 ); |
576 |
child->setNextSibling( 0 ); |
584 |
child->setNextSibling( 0 ); |