[core][android] Remove unaccent from platform interfaces
The unaccent is used only within collator, thus, there is no need to have separate platform interface for it.
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
#include <mbgl/text/language_tag.hpp>
|
||||
#include <mbgl/util/platform.hpp>
|
||||
|
||||
#include <mbgl/text/unaccent.hpp>
|
||||
|
||||
#include <jni/jni.hpp>
|
||||
|
||||
#include "../attach_env.hpp"
|
||||
@@ -144,12 +142,10 @@ public:
|
||||
// Because of the difference in locale-awareness, this means turning on case-sensitivity
|
||||
// can _potentially_ change compare results for strings that don't actually have any case
|
||||
// differences.
|
||||
jni::Local<jni::String> jlhs = jni::Make<jni::String>(*env, useUnaccent ?
|
||||
platform::unaccent(lhs) :
|
||||
lhs);
|
||||
jni::Local<jni::String> jrhs = jni::Make<jni::String>(*env, useUnaccent ?
|
||||
platform::unaccent(rhs) :
|
||||
rhs);
|
||||
jni::Local<jni::String> jlhs = useUnaccent ? android::StringUtils::unaccent(*env, jni::Make<jni::String>(*env, lhs))
|
||||
: jni::Make<jni::String>(*env, lhs);
|
||||
jni::Local<jni::String> jrhs = useUnaccent ? android::StringUtils::unaccent(*env, jni::Make<jni::String>(*env, rhs))
|
||||
: jni::Make<jni::String>(*env, rhs);
|
||||
|
||||
jni::jint result = android::Collator::compare(*env, collator, jlhs, jrhs);
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#include <mbgl/text/unaccent.hpp>
|
||||
#include <string>
|
||||
#include "attach_env.hpp"
|
||||
#include "text/collator_jni.hpp"
|
||||
#include <jni/jni.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
namespace platform {
|
||||
|
||||
std::string unaccent(const std::string& str) {
|
||||
android::UniqueEnv env = android::AttachEnv();
|
||||
jni::Local<jni::String> input = jni::Make<jni::String>(*env, str);
|
||||
jni::Local<jni::String> unaccented = android::StringUtils::unaccent(*env, input);
|
||||
return jni::Make<std::string>(*env, unaccented);
|
||||
}
|
||||
|
||||
} // namespace platform
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user