| 1039 | } |
| 1040 | |
| 1041 | void WorkspaceObject_Impl::restorePointers() { |
| 1042 | OS_ASSERT(!m_handle.isNull()); |
| 1043 | if (m_sourceData) { |
| 1044 | for (const ForwardPointer& ptr : m_sourceData->pointers) { |
| 1045 | if (!ptr.targetHandle.isNull()) { |
| 1046 | OptionalWorkspaceObject target = m_workspace->getObject(ptr.targetHandle); |
| 1047 | if (target) { |
| 1048 | WorkspaceObjectVector sources = target->getSources(iddObject().type()); |
| 1049 | HandleVector h = getHandles<WorkspaceObject>(sources); |
| 1050 | if (std::find(h.begin(), h.end(), m_handle) == h.end()) { |
| 1051 | target->getImpl<WorkspaceObject_Impl>()->setReversePointer(m_handle, ptr.fieldIndex); |
| 1052 | } |
| 1053 | } |
| 1054 | } |
| 1055 | } |
| 1056 | } |
| 1057 | if (m_targetData) { |
| 1058 | for (const ReversePointer& ptr : m_targetData->reversePointers) { |
| 1059 | OptionalWorkspaceObject source = m_workspace->getObject(ptr.sourceHandle); |
| 1060 | if (source) { |
| 1061 | OptionalWorkspaceObject oTarget = source->getTarget(ptr.fieldIndex); |
| 1062 | OptionalHandle h; |
| 1063 | if (oTarget) { |
| 1064 | h = oTarget->handle(); |
| 1065 | } |
| 1066 | if ((!h) || (*h != m_handle)) { |
| 1067 | source->getImpl<WorkspaceObject_Impl>()->setPointer(ptr.fieldIndex, m_handle, false); |
| 1068 | } |
| 1069 | } |
| 1070 | } |
| 1071 | } |
| 1072 | } |
| 1073 | |
| 1074 | // PRIVATE |
| 1075 |
no test coverage detected