| 99 | } |
| 100 | |
| 101 | void DocumentObject::printInvalidLinks() const |
| 102 | { |
| 103 | try { |
| 104 | // Get objects that have invalid link scope, and print their names. |
| 105 | // Truncate the invalid object list name strings for readability, if they happen to be very |
| 106 | // long. |
| 107 | std::vector<App::DocumentObject*> invalid_linkobjs; |
| 108 | std::string objnames, scopenames; |
| 109 | GeoFeatureGroupExtension::getInvalidLinkObjects(this, invalid_linkobjs); |
| 110 | for (auto& obj : invalid_linkobjs) { |
| 111 | objnames += obj->getNameInDocument(); |
| 112 | objnames += " "; |
| 113 | for (auto& scope : obj->getParents()) { |
| 114 | if (scopenames.length() > 80) { |
| 115 | scopenames += "... "; |
| 116 | break; |
| 117 | } |
| 118 | |
| 119 | scopenames += scope.first->getNameInDocument(); |
| 120 | scopenames += " "; |
| 121 | } |
| 122 | |
| 123 | if (objnames.length() > 80) { |
| 124 | objnames += "... "; |
| 125 | break; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | if (objnames.empty()) { |
| 130 | objnames = "N/A"; |
| 131 | } |
| 132 | else { |
| 133 | objnames.pop_back(); |
| 134 | } |
| 135 | |
| 136 | if (scopenames.empty()) { |
| 137 | scopenames = "N/A"; |
| 138 | } |
| 139 | else { |
| 140 | scopenames.pop_back(); |
| 141 | } |
| 142 | |
| 143 | Base::Console().warning("%s: %s links are out of scope. Out of scope links to: %s\n", |
| 144 | getTypeId().getName(), |
| 145 | getNameInDocument(), |
| 146 | objnames.c_str()); |
| 147 | } |
| 148 | catch (const Base::Exception& e) { |
| 149 | e.reportException(); |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | App::DocumentObjectExecReturn* DocumentObject::recompute() |
| 154 | { |
nothing calls this directly
no test coverage detected