diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 62ee095b40..78c1ae1ff4 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -1760,8 +1760,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 diff --git a/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp b/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp index 84fd9f6c0a..45bb90e74a 100644 --- a/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp +++ b/android/jni/com/mapswithme/maps/bookmarks/data/BookmarkManager.cpp @@ -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(); @@ -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 @@ -780,7 +780,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUpdateBookmarkPlac buildInfo.m_userMarkId = static_cast(bmkId); frm()->UpdatePlacePageInfoForCurrentSelection(buildInfo); - return usermark_helper::CreateMapObject(env, info); + return usermark_helper::CreateMapObject(env, g_framework->GetPlacePageInfo()); } JNIEXPORT jobject JNICALL diff --git a/map/framework.cpp b/map/framework.cpp index 8ea64595b3..26b616bf13 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2614,7 +2614,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; }