Review fixes.

This commit is contained in:
Daria Volvenkova 2017-06-09 10:28:18 +03:00
parent 82159cb74e
commit ead806a4ef
3 changed files with 7 additions and 26 deletions

View file

@ -947,30 +947,8 @@ void Framework::FillRouteMarkInfo(RouteMarkPoint const & rmp, place_page::Info &
{
FillPointInfo(rmp.GetPivot(), "", info);
info.m_isRoutePoint = true;
std::string title;
RouteMarkType const type = rmp.GetRoutePointType();
int8_t const intermediateIndex = rmp.GetIntermediateIndex();
switch (type)
{
case RouteMarkType::Start:
title = "Start";
break;
case RouteMarkType::Intermediate:
if (intermediateIndex == 0)
title = "First stop A";
else if (intermediateIndex == 1)
title = "Second stop B";
else
title = "Third stop C";
break;
case RouteMarkType::Finish:
title = "Finish";
break;
}
info.m_customName = title;
info.m_routeMarkType = type;
info.m_intermediateIndex = intermediateIndex;
info.m_routeMarkType = rmp.GetRoutePointType();
info.m_intermediateIndex = rmp.GetIntermediateIndex();
}
void Framework::ShowBookmark(BookmarkAndCategory const & bnc)

View file

@ -53,11 +53,14 @@ UserMark * RouteUserMarkContainer::AllocateUserMark(m2::PointD const & ptOrg)
return new RouteMarkPoint(ptOrg, this);
}
int8_t const RoutePointsLayout::kMaxIntermediatePointsCount = 1;
RoutePointsLayout::RoutePointsLayout(UserMarksController & routeMarks)
: m_routeMarks(routeMarks)
{}
RouteMarkPoint * RoutePointsLayout::AddRoutePoint(m2::PointD const & ptOrg, RouteMarkType type, int8_t intermediateIndex)
RouteMarkPoint * RoutePointsLayout::AddRoutePoint(m2::PointD const & ptOrg, RouteMarkType type,
int8_t intermediateIndex)
{
if (m_routeMarks.GetUserMarkCount() == kMaxIntermediatePointsCount + 2)
return nullptr;

View file

@ -50,7 +50,7 @@ protected:
class RoutePointsLayout
{
public:
static int8_t const kMaxIntermediatePointsCount = 1;
static int8_t const kMaxIntermediatePointsCount;
RoutePointsLayout(UserMarksController & routeMarks);