* commit '6291beddfcdf843f07f12a6d4551301e5fcff73c': Use the icu:: namespace for icu4c API.
This commit is contained in:
@ -22,6 +22,8 @@ endif
|
|||||||
|
|
||||||
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
|
LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DEGL_EGLEXT_PROTOTYPES
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -DU_USING_ICU_NAMESPACE=0
|
||||||
|
|
||||||
LOCAL_SRC_FILES:= \
|
LOCAL_SRC_FILES:= \
|
||||||
AndroidRuntime.cpp \
|
AndroidRuntime.cpp \
|
||||||
com_android_internal_content_NativeLibraryHelper.cpp \
|
com_android_internal_content_NativeLibraryHelper.cpp \
|
||||||
|
@ -30,7 +30,7 @@ namespace android {
|
|||||||
|
|
||||||
class ScopedBreakIterator {
|
class ScopedBreakIterator {
|
||||||
public:
|
public:
|
||||||
ScopedBreakIterator(JNIEnv* env, BreakIterator* breakIterator, jcharArray inputText,
|
ScopedBreakIterator(JNIEnv* env, icu::BreakIterator* breakIterator, jcharArray inputText,
|
||||||
jint length) : mBreakIterator(breakIterator), mChars(env, inputText) {
|
jint length) : mBreakIterator(breakIterator), mChars(env, inputText) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
mUText = utext_openUChars(NULL, mChars.get(), length, &status);
|
mUText = utext_openUChars(NULL, mChars.get(), length, &status);
|
||||||
@ -41,7 +41,7 @@ class ScopedBreakIterator {
|
|||||||
mBreakIterator->setText(mUText, status);
|
mBreakIterator->setText(mUText, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline BreakIterator* operator->() {
|
inline icu::BreakIterator* operator->() {
|
||||||
return mBreakIterator;
|
return mBreakIterator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ class ScopedBreakIterator {
|
|||||||
delete mBreakIterator;
|
delete mBreakIterator;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
BreakIterator* mBreakIterator;
|
icu::BreakIterator* mBreakIterator;
|
||||||
ScopedCharArrayRO mChars;
|
ScopedCharArrayRO mChars;
|
||||||
UText* mUText;
|
UText* mUText;
|
||||||
|
|
||||||
@ -68,14 +68,14 @@ static jintArray nLineBreakOpportunities(JNIEnv* env, jclass, jstring javaLocale
|
|||||||
ScopedIcuLocale icuLocale(env, javaLocaleName);
|
ScopedIcuLocale icuLocale(env, javaLocaleName);
|
||||||
if (icuLocale.valid()) {
|
if (icuLocale.valid()) {
|
||||||
UErrorCode status = U_ZERO_ERROR;
|
UErrorCode status = U_ZERO_ERROR;
|
||||||
BreakIterator* it = BreakIterator::createLineInstance(icuLocale.locale(), status);
|
icu::BreakIterator* it = icu::BreakIterator::createLineInstance(icuLocale.locale(), status);
|
||||||
if (!U_SUCCESS(status) || it == NULL) {
|
if (!U_SUCCESS(status) || it == NULL) {
|
||||||
if (it) {
|
if (it) {
|
||||||
delete it;
|
delete it;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ScopedBreakIterator breakIterator(env, it, inputText, length);
|
ScopedBreakIterator breakIterator(env, it, inputText, length);
|
||||||
for (int loc = breakIterator->first(); loc != BreakIterator::DONE;
|
for (int loc = breakIterator->first(); loc != icu::BreakIterator::DONE;
|
||||||
loc = breakIterator->next()) {
|
loc = breakIterator->next()) {
|
||||||
breaks.push_back(loc);
|
breaks.push_back(loc);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user