| 2964 | } |
| 2965 | |
| 2966 | bool Framework::GetEditableMapObject(FeatureID const & fid, osm::EditableMapObject & emo) const |
| 2967 | { |
| 2968 | if (!fid.IsValid()) |
| 2969 | return false; |
| 2970 | |
| 2971 | FeaturesLoaderGuard guard(m_featuresFetcher.GetDataSource(), fid.m_mwmId); |
| 2972 | auto ft = guard.GetFeatureByIndex(fid.m_index); |
| 2973 | if (!ft) |
| 2974 | return false; |
| 2975 | |
| 2976 | emo = {}; |
| 2977 | emo.SetFromFeatureType(*ft); |
| 2978 | auto const & editor = osm::Editor::Instance(); |
| 2979 | emo.SetEditableProperties(editor.GetEditableProperties(*ft)); |
| 2980 | |
| 2981 | auto const & dataSource = m_featuresFetcher.GetDataSource(); |
| 2982 | search::ReverseGeocoder const coder(dataSource); |
| 2983 | SetStreet(coder, dataSource, *ft, emo); |
| 2984 | |
| 2985 | if (!ftypes::IsBuildingChecker::Instance()(*ft) && |
| 2986 | (emo.GetHouseNumber().empty() || emo.GetStreet().m_defaultName.empty())) |
| 2987 | { |
| 2988 | SetHostingBuildingAddress(FindBuildingAtPoint(feature::GetCenter(*ft)), dataSource, coder, emo); |
| 2989 | } |
| 2990 | |
| 2991 | auto optJournal = editor.GetEditedFeatureJournal(fid); |
| 2992 | if (optJournal) |
| 2993 | emo.SetJournal(std::move(*optJournal)); |
| 2994 | |
| 2995 | return true; |
| 2996 | } |
| 2997 | |
| 2998 | osm::Editor::SaveResult Framework::SaveEditedMapObject(osm::EditableMapObject emo) |
| 2999 | { |
no test coverage detected