[editor] Clear selected feature on rollback.

This commit is contained in:
Dmitry Yunitsky 2016-05-04 13:57:55 +03:00 committed by Vladimir Byko-Ianko
parent 1e9c57b2e8
commit 990eea1bf1
2 changed files with 14 additions and 0 deletions

View file

@ -2796,9 +2796,22 @@ void Framework::DeleteFeature(FeatureID const & fid) const
{
// TODO(AlexZ): Use FeatureID in the editor interface.
osm::Editor::Instance().DeleteFeature(*GetFeatureByID(fid));
if (m_selectedFeature == fid)
m_selectedFeature = FeatureID();
}
osm::NewFeatureCategories Framework::GetEditorCategories() const
{
return osm::Editor::Instance().GetNewFeatureCategories();
}
bool Framework::RollBackChanges(FeatureID const & fid)
{
if (m_selectedFeature == fid)
m_selectedFeature = FeatureID();
if (osm::Editor::Instance().GetFeatureStatus(fid) == osm::Editor::FeatureStatus::Created)
DeactivateMapSelection(false);
else
UpdatePlacePageInfoForCurrentSelection();
return osm::Editor::Instance().RollBackChanges(fid);
}

View file

@ -647,6 +647,7 @@ public:
osm::Editor::SaveResult SaveEditedMapObject(osm::EditableMapObject emo);
void DeleteFeature(FeatureID const & fid) const;
osm::NewFeatureCategories GetEditorCategories() const;
bool RollBackChanges(FeatureID const & fid);
//@}
private: