| 342 | } |
| 343 | |
| 344 | void PropertyExpressionEngine::updateHiddenReference(const std::string& key) |
| 345 | { |
| 346 | if (!pimpl) { |
| 347 | return; |
| 348 | } |
| 349 | auto it = pimpl->propMap.find(key); |
| 350 | if (it == pimpl->propMap.end()) { |
| 351 | return; |
| 352 | } |
| 353 | for (auto& var : it->second) { |
| 354 | auto it = expressions.find(var); |
| 355 | if (it == expressions.end() || it->second.busy) { |
| 356 | continue; |
| 357 | } |
| 358 | Property* myProp = var.getProperty(); |
| 359 | if (!myProp) { |
| 360 | continue; |
| 361 | } |
| 362 | Base::StateLocker guard(it->second.busy); |
| 363 | App::any value; |
| 364 | try { |
| 365 | value = it->second.expression->getValueAsAny(); |
| 366 | if (!isAnyEqual(value, myProp->getPathValue(var))) { |
| 367 | myProp->setPathValue(var, value); |
| 368 | } |
| 369 | } |
| 370 | catch (Base::Exception& e) { |
| 371 | e.reportException(); |
| 372 | FC_ERR("Failed to evaluate property binding " << myProp->getFullName() |
| 373 | << " on change of " << key); |
| 374 | } |
| 375 | catch (std::bad_cast&) { |
| 376 | FC_ERR("Invalid type '" << value.type().name() << "' in property binding " |
| 377 | << myProp->getFullName() << " on change of " << key); |
| 378 | } |
| 379 | catch (std::exception& e) { |
| 380 | FC_ERR(e.what()); |
| 381 | FC_ERR("Failed to evaluate property binding " << myProp->getFullName() |
| 382 | << " on change of " << key); |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | void PropertyExpressionEngine::slotChangedObject(const App::DocumentObject& obj, |
| 388 | const App::Property&) |
nothing calls this directly
no test coverage detected