Skip to content

Commit

Permalink
[bookmarks][android] Fixed finding nearest bookmark.
Browse files Browse the repository at this point in the history
  • Loading branch information
darina authored and alexzatsepin committed Dec 23, 2019
1 parent 7265571 commit 766818f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 1 addition & 2 deletions android/jni/com/mapswithme/maps/Framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1759,8 +1759,7 @@ Java_com_mapswithme_maps_Framework_nativeDeleteBookmarkFromMapObject(JNIEnv * en
buildInfo.m_source = place_page::BuildInfo::Source::Other;
frm()->UpdatePlacePageInfoForCurrentSelection(buildInfo);

place_page::Info const & updatedInfo = g_framework->GetPlacePageInfo();
return usermark_helper::CreateMapObject(env, updatedInfo);
return usermark_helper::CreateMapObject(env, g_framework->GetPlacePageInfo());
}

JNIEXPORT void JNICALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAddBookmarkToLastE
{
BookmarkManager & bmMng = frm()->GetBookmarkManager();

place_page::Info & info = g_framework->GetPlacePageInfo();
place_page::Info const & info = g_framework->GetPlacePageInfo();

kml::BookmarkData bmData;
bmData.m_name = info.FormatNewBookmarkName();
Expand All @@ -643,7 +643,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAddBookmarkToLastE
buildInfo.m_userMarkId = createdBookmark->GetId();
frm()->UpdatePlacePageInfoForCurrentSelection(buildInfo);

return usermark_helper::CreateMapObject(env, info);
return usermark_helper::CreateMapObject(env, g_framework->GetPlacePageInfo());
}

JNIEXPORT jlong JNICALL
Expand Down Expand Up @@ -780,7 +780,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUpdateBookmarkPlac
buildInfo.m_userMarkId = static_cast<kml::MarkId>(bmkId);
frm()->UpdatePlacePageInfoForCurrentSelection(buildInfo);

return usermark_helper::CreateMapObject(env, info);
return usermark_helper::CreateMapObject(env, g_framework->GetPlacePageInfo());
}

JNIEXPORT jobject JNICALL
Expand Down
4 changes: 3 additions & 1 deletion map/framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2655,7 +2655,9 @@ UserMark const * Framework::FindUserMarkInTapPosition(place_page::BuildInfo cons
{
if (buildInfo.m_userMarkId != kml::kInvalidMarkId)
{
auto mark = GetBookmarkManager().GetUserMark(buildInfo.m_userMarkId);
auto const & bm = GetBookmarkManager();
auto mark = bm.IsBookmark(buildInfo.m_userMarkId) ? bm.GetBookmark(buildInfo.m_userMarkId)
: bm.GetUserMark(buildInfo.m_userMarkId);
if (mark != nullptr)
return mark;
}
Expand Down

0 comments on commit 766818f

Please sign in to comment.