| 127 | } |
| 128 | |
| 129 | bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj) const |
| 130 | { |
| 131 | #ifdef FC_DEBUG |
| 132 | Base::Console().log("Check ViewProviderGroupExtension\n"); |
| 133 | #endif |
| 134 | |
| 135 | auto extobj = getExtendedViewProvider()->getObject(); |
| 136 | auto group = extobj->getExtensionByType<App::GroupExtension>(); |
| 137 | |
| 138 | // we cannot drop thing of this group into it again if it does not allow reorder |
| 139 | if (group->hasObject(obj) && !getExtendedViewProvider()->acceptReorderingObjects()) { |
| 140 | return false; |
| 141 | } |
| 142 | |
| 143 | // Check for possible cyclic dependencies if we allowed to drop the object |
| 144 | const auto& list = obj->getOutList(); |
| 145 | if (std::ranges::find(list, extobj) != list.end()) { |
| 146 | Base::Console().warning("Do not add cyclic dependency to %s\n", extobj->Label.getValue()); |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | return group->allowObject(obj); |
| 151 | } |
| 152 | |
| 153 | void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) |
| 154 | { |
no test coverage detected