| 823 | } |
| 824 | |
| 825 | bool DocumentObject::removeDynamicProperty(const char* name) |
| 826 | { |
| 827 | if (!_pDoc || testStatus(ObjectStatus::Destroy)) { |
| 828 | return false; |
| 829 | } |
| 830 | |
| 831 | Property* prop = getDynamicPropertyByName(name); |
| 832 | if (!prop || prop->testStatus(App::Property::LockDynamic)) { |
| 833 | return false; |
| 834 | } |
| 835 | |
| 836 | if (prop->isDerivedFrom<PropertyLinkBase>()) { |
| 837 | clearOutListCache(); |
| 838 | } |
| 839 | |
| 840 | _pDoc->addOrRemovePropertyOfObject(this, prop, false); |
| 841 | |
| 842 | auto expressions = ExpressionEngine.getExpressions(); |
| 843 | std::vector<App::ObjectIdentifier> removeExpr; |
| 844 | |
| 845 | for (const auto& it : expressions) { |
| 846 | if (it.first.getProperty() == prop) { |
| 847 | removeExpr.push_back(it.first); |
| 848 | } |
| 849 | } |
| 850 | |
| 851 | for (const auto& it : removeExpr) { |
| 852 | ExpressionEngine.setValue(it, std::shared_ptr<Expression>()); |
| 853 | } |
| 854 | |
| 855 | return TransactionalObject::removeDynamicProperty(name); |
| 856 | } |
| 857 | |
| 858 | bool DocumentObject::renameDynamicProperty(Property* prop, const char* name) |
| 859 | { |
no test coverage detected