clang-format

This commit is contained in:
Roman Romanov 2016-11-21 07:55:49 +04:00
parent 974f5795f0
commit 228f3c130e
3 changed files with 36 additions and 38 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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;