| 870 | } |
| 871 | |
| 872 | bool Editor::MarkFeatureAsObsolete(FeatureID const & fid) |
| 873 | { |
| 874 | CHECK_THREAD_CHECKER(MainThreadChecker, ("")); |
| 875 | |
| 876 | auto const features = m_features.Get(); |
| 877 | auto editableFeatures = make_shared<FeaturesContainer>(*features); |
| 878 | |
| 879 | auto const featureStatus = GetFeatureStatusImpl(*editableFeatures, fid.m_mwmId, fid.m_index); |
| 880 | if (featureStatus != FeatureStatus::Untouched && featureStatus != FeatureStatus::Modified) |
| 881 | { |
| 882 | ASSERT(false, ("Only untouched and modified features can be made obsolete")); |
| 883 | return false; |
| 884 | } |
| 885 | |
| 886 | MarkFeatureWithStatus(*editableFeatures, fid, FeatureStatus::Obsolete); |
| 887 | auto const result = SaveTransaction(editableFeatures); |
| 888 | Invalidate(); |
| 889 | |
| 890 | return result; |
| 891 | } |
| 892 | |
| 893 | bool Editor::RemoveFeature(FeatureID const & fid) |
| 894 | { |