| 483 | } |
| 484 | |
| 485 | void DUContext::setOwner(Declaration* owner) |
| 486 | { |
| 487 | ENSURE_CAN_WRITE |
| 488 | DUCHAIN_D_DYNAMIC(DUContext); |
| 489 | if (owner == d->m_owner.declaration()) |
| 490 | return; |
| 491 | |
| 492 | Declaration* oldOwner = d->m_owner.declaration(); |
| 493 | |
| 494 | d->m_owner = owner; |
| 495 | |
| 496 | //Q_ASSERT(!oldOwner || oldOwner->internalContext() == this); |
| 497 | if (oldOwner && oldOwner->internalContext() == this) |
| 498 | oldOwner->setInternalContext(nullptr); |
| 499 | |
| 500 | //The context set as internal context should always be the last opened context |
| 501 | if (owner) |
| 502 | owner->setInternalContext(this); |
| 503 | } |
| 504 | |
| 505 | DUContext* DUContext::parentContext() const |
| 506 | { |
no test coverage detected