[and] Compilation fix.
This commit is contained in:
parent
085ea6dfe9
commit
466fe738a7
2 changed files with 17 additions and 2 deletions
|
@ -103,13 +103,17 @@ jobject NativeArticle2JavaArticle(JNIEnv * env, ArticleInfo const * p)
|
|||
jclass ArtInfoClass = env->FindClass("com/guidewithme/article/ArticleInfo");
|
||||
jmethodID initId = env->GetMethodID(ArtInfoClass, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;DD)V");
|
||||
|
||||
double lat = -1000;
|
||||
double lon = -1000;
|
||||
p->GetLatLon(lat, lon);
|
||||
|
||||
return env->NewObject(ArtInfoClass, initId,
|
||||
StdString2JString(env, p->GetUrl()),
|
||||
StdString2JString(env, p->GetThumbnailUrl()),
|
||||
StdString2JString(env, p->GetTitle()),
|
||||
StdString2JString(env, STORAGE.GetParentName(*p)),
|
||||
p->m_lat,
|
||||
p->m_lon);
|
||||
lat,
|
||||
lon);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -64,6 +64,17 @@ public:
|
|||
void Write(wr::Writer & w) const;
|
||||
void Read(rd::Reader & r);
|
||||
|
||||
bool GetLatLon(double & lat, double & lon) const
|
||||
{
|
||||
if (IsValidCoordinates())
|
||||
{
|
||||
lat = m_lat;
|
||||
lon = m_lon;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Calculate score for info. Less is better.
|
||||
double Score(double currLat, double currLon) const;
|
||||
|
||||
|
|
Reference in a new issue