| 1449 | } |
| 1450 | |
| 1451 | int Application::checkLinkDepth(int depth, MessageOption option) |
| 1452 | { |
| 1453 | if (_objCount < 0) { |
| 1454 | _objCount = 0; |
| 1455 | for (const auto &v : DocMap) { |
| 1456 | _objCount += v.second->countObjects(); |
| 1457 | } |
| 1458 | } |
| 1459 | |
| 1460 | if (depth > _objCount + 2) { |
| 1461 | const auto msg = "Link recursion limit reached. " |
| 1462 | "Please check for cyclic reference."; |
| 1463 | switch (option) { |
| 1464 | case MessageOption::Quiet: |
| 1465 | return 0; |
| 1466 | case MessageOption::Error: |
| 1467 | FC_ERR(msg); |
| 1468 | return 0; |
| 1469 | case MessageOption::Throw: |
| 1470 | throw Base::RuntimeError(msg); |
| 1471 | } |
| 1472 | } |
| 1473 | |
| 1474 | return _objCount + 2; |
| 1475 | } |
| 1476 | |
| 1477 | std::set<DocumentObject *> Application::getLinksTo( |
| 1478 | const DocumentObject *obj, int options, int maxCount) const |
no test coverage detected