diff options
author | Roman Romanov <rromanov@65gb.net> | 2016-11-21 06:55:49 +0300 |
---|---|---|
committer | Roman Romanov <rromanov@65gb.net> | 2016-11-24 07:46:03 +0300 |
commit | 228f3c130eef521f56355a81a222f2777ff7531b (patch) | |
tree | c213e2b520a6baae66e89ccd0234569ce9d95c86 | |
parent | 974f5795f0a7afc2fc05e819618cace4a6f9294a (diff) |
clang-format
-rw-r--r-- | android/jni/com/mapswithme/maps/Framework.cpp | 61 | ||||
-rw-r--r-- | android/jni/com/mapswithme/maps/editor/Editor.cpp | 4 | ||||
-rw-r--r-- | map/framework.cpp | 9 |
3 files changed, 36 insertions, 38 deletions
diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index 06f4284236..3940fe0622 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -625,43 +625,42 @@ Java_com_mapswithme_maps_Framework_nativeSetMapObjectListener(JNIEnv * env, jcla }); } -JNIEXPORT void JNICALL -Java_com_mapswithme_maps_Framework_nativeRestoreMapObject(JNIEnv * env, jclass clazz, - jobject jMapObject) +JNIEXPORT void JNICALL Java_com_mapswithme_maps_Framework_nativeRestoreMapObject(JNIEnv * env, + jclass clazz, + jobject jMapObject) { - jmethodID const getMapObjectTypeId = - jni::GetMethodID(env, jMapObject, "getMapObjectType", "()I"); + jmethodID const getMapObjectTypeId = jni::GetMethodID(env, jMapObject, "getMapObjectType", "()I"); place_page::Info info; jint type = env->CallIntMethod(jMapObject, getMapObjectTypeId); switch (type) { - case 2: - { - jmethodID const getCategoryId = jni::GetMethodID(env, jMapObject, "getCategoryId", "()I"); - jmethodID const getBookmarkId = jni::GetMethodID(env, jMapObject, "getBookmarkId", "()I"); - jint categoryId = env->CallIntMethod(jMapObject, getCategoryId); - jint bookmarkId = env->CallIntMethod(jMapObject, getBookmarkId); - BookmarkAndCategory bnc = BookmarkAndCategory(bookmarkId, categoryId); - BookmarkCategory * pCat = frm()->GetBmCategory(categoryId); - Bookmark const * pBmk = static_cast<Bookmark const *>(pCat->GetUserMark(bookmarkId)); - frm()->FillBookmarkInfo(*pBmk, bnc, info); - break; - } - case 3: - { - frm()->FillMyPositionInfo(info); - break; - } - default: - { - jmethodID const getLatId = jni::GetMethodID(env, jMapObject, "getLat", "()D"); - jmethodID const getLonId = jni::GetMethodID(env, jMapObject, "getLon", "()D"); - jdouble lat = env->CallDoubleMethod(jMapObject, getLatId); - jdouble lon = env->CallDoubleMethod(jMapObject, getLonId); - frm()->FillPoiInfo(m2::PointD(MercatorBounds::FromLatLon(lat, lon)), info); - break; - } + case 2: + { + jmethodID const getCategoryId = jni::GetMethodID(env, jMapObject, "getCategoryId", "()I"); + jmethodID const getBookmarkId = jni::GetMethodID(env, jMapObject, "getBookmarkId", "()I"); + jint categoryId = env->CallIntMethod(jMapObject, getCategoryId); + jint bookmarkId = env->CallIntMethod(jMapObject, getBookmarkId); + BookmarkAndCategory bnc = BookmarkAndCategory(bookmarkId, categoryId); + BookmarkCategory * pCat = frm()->GetBmCategory(categoryId); + Bookmark const * pBmk = static_cast<Bookmark const *>(pCat->GetUserMark(bookmarkId)); + frm()->FillBookmarkInfo(*pBmk, bnc, info); + break; + } + case 3: + { + frm()->FillMyPositionInfo(info); + break; + } + default: + { + jmethodID const getLatId = jni::GetMethodID(env, jMapObject, "getLat", "()D"); + jmethodID const getLonId = jni::GetMethodID(env, jMapObject, "getLon", "()D"); + jdouble lat = env->CallDoubleMethod(jMapObject, getLatId); + jdouble lon = env->CallDoubleMethod(jMapObject, getLonId); + frm()->FillPoiInfo(m2::PointD(MercatorBounds::FromLatLon(lat, lon)), info); + break; + } } g_framework->SetPlacePageInfo(info); diff --git a/android/jni/com/mapswithme/maps/editor/Editor.cpp b/android/jni/com/mapswithme/maps/editor/Editor.cpp index 53aa2cf6a9..2040fee1e2 100644 --- a/android/jni/com/mapswithme/maps/editor/Editor.cpp +++ b/android/jni/com/mapswithme/maps/editor/Editor.cpp @@ -417,8 +417,8 @@ Java_com_mapswithme_maps_editor_Editor_nativeClearLocalEdits(JNIEnv * env, jclas Editor::Instance().ClearAllLocalEdits(); } -JNIEXPORT void JNICALL -Java_com_mapswithme_maps_editor_Editor_nativeStartEdit(JNIEnv *, jclass, jint drawScale = -1) +JNIEXPORT void JNICALL Java_com_mapswithme_maps_editor_Editor_nativeStartEdit(JNIEnv *, jclass, + jint drawScale = -1) { ::Framework * frm = g_framework->NativeFramework(); place_page::Info const & info = g_framework->GetPlacePageInfo(); diff --git a/map/framework.cpp b/map/framework.cpp index f53812f51e..9231dd0bbf 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -2114,9 +2114,8 @@ void Framework::UpdateMinBuildingsTapZoom() FeatureID Framework::FindBuildingAtPoint(m2::PointD const & mercator, int drawScale /*= -1*/) const { FeatureID featureId; - bool matchZoom = drawScale < 0 - ? GetDrawScale() >= m_minBuildingsTapZoom - : drawScale >= m_minBuildingsTapZoom; + bool matchZoom = + drawScale < 0 ? GetDrawScale() >= m_minBuildingsTapZoom : drawScale >= m_minBuildingsTapZoom; if (matchZoom) { constexpr int kScale = scales::GetUpperScale(); @@ -2974,8 +2973,8 @@ bool Framework::GetEditableMapObject(FeatureID const & fid, osm::EditableMapObje if (!ftypes::IsBuildingChecker::Instance()(ft) && (emo.GetHouseNumber().empty() || emo.GetStreet().m_defaultName.empty())) { - SetHostingBuildingAddress(FindBuildingAtPoint(feature::GetCenter(ft), drawScale), - index, coder, emo); + SetHostingBuildingAddress(FindBuildingAtPoint(feature::GetCenter(ft), drawScale), index, coder, + emo); } return true; |