forked from organicmaps/organicmaps
Review fixes.
This commit is contained in:
parent
51368b1055
commit
abb449bc7f
2 changed files with 7 additions and 7 deletions
|
@ -20,7 +20,6 @@ import android.widget.EditText;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.base.BaseMwmFragment;
|
||||
import com.mapswithme.maps.bookmarks.data.Metadata.MetadataType;
|
||||
|
@ -434,10 +433,10 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
|||
switch (Editor.nativeGetMapObjectStatus())
|
||||
{
|
||||
case Editor.CREATED:
|
||||
resetCreated(Editor.CREATED);
|
||||
rollback(Editor.CREATED);
|
||||
break;
|
||||
case Editor.MODIFIED:
|
||||
resetCreated(Editor.MODIFIED);
|
||||
rollback(Editor.MODIFIED);
|
||||
break;
|
||||
case Editor.UNTOUCHED:
|
||||
placeDoesntExist();
|
||||
|
@ -447,7 +446,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
|||
}
|
||||
}
|
||||
|
||||
private void resetCreated(@Editor.FeatureStatus int status)
|
||||
private void rollback(@Editor.FeatureStatus int status)
|
||||
{
|
||||
int title;
|
||||
int message;
|
||||
|
|
|
@ -2807,11 +2807,12 @@ osm::NewFeatureCategories Framework::GetEditorCategories() const
|
|||
|
||||
bool Framework::RollBackChanges(FeatureID const & fid)
|
||||
{
|
||||
if (m_selectedFeature == fid)
|
||||
if (m_selectedFeature == fid) // reset selected feature since it becomes invalid after rollback
|
||||
m_selectedFeature = FeatureID();
|
||||
if (osm::Editor::Instance().GetFeatureStatus(fid) == osm::Editor::FeatureStatus::Created)
|
||||
auto const & editor = osm::Editor::Instance();
|
||||
if (editor.GetFeatureStatus(fid) == osm::Editor::FeatureStatus::Created)
|
||||
DeactivateMapSelection(false);
|
||||
else
|
||||
UpdatePlacePageInfoForCurrentSelection();
|
||||
return osm::Editor::Instance().RollBackChanges(fid);
|
||||
return editor.RollBackChanges(fid);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue