Corrected feature access in the desktop Editor.

This commit is contained in:
Alex Zolotarev 2016-01-04 17:25:08 +03:00 committed by Sergey Yershov
parent d3806edf61
commit 5fb8b4be1e
2 changed files with 5 additions and 9 deletions

View file

@ -85,9 +85,9 @@ DrawWidget::DrawWidget(QWidget * parent)
// TODO: Why do we get empty mark in some cases?
if (mark)
{
auto const * m = mark->GetUserMark();
if (m->GetMarkType() == UserMark::Type::POI)
ShowPOIEditor(m->GetPivot());
FeatureType * feature = mark->GetUserMark()->GetFeature();
if (feature)
ShowPOIEditor(*feature);
}
});
@ -466,12 +466,8 @@ void DrawWidget::SubmitRoutingPoint(m2::PointD const & pt)
m_framework->BuildRoute(m_framework->PtoG(pt), 0 /* timeoutSec */);
}
void DrawWidget::ShowPOIEditor(m2::PointD const & pt)
void DrawWidget::ShowPOIEditor(FeatureType & feature)
{
FeatureType feature;
if (!m_framework->GetVisiblePOI(pt, feature))
return;
// Show Edit POI dialog.
auto & editor = osm::Editor::Instance();
EditorDialog dlg(this, feature);

View file

@ -89,7 +89,7 @@ namespace qt
void SubmitFakeLocationPoint(m2::PointD const & pt);
void SubmitRoutingPoint(m2::PointD const & pt);
void ShowInfoPopup(QMouseEvent * e, m2::PointD const & pt);
void ShowPOIEditor(m2::PointD const & pt);
void ShowPOIEditor(FeatureType & feature);
void OnViewportChanged(ScreenBase const & screen);
void UpdateScaleControl();