From: Peng Wu Date: Wed, 7 Nov 2012 05:05:48 +0000 (+0800) Subject: fixes pinyin_load_phrase_library X-Git-Tag: 0.8.91~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4b9e9b1371a8aa16bbab99dfdb84608ead6507a;p=platform%2Fupstream%2Flibpinyin.git fixes pinyin_load_phrase_library --- diff --git a/src/pinyin.cpp b/src/pinyin.cpp index 709af15..edc6244 100644 --- a/src/pinyin.cpp +++ b/src/pinyin.cpp @@ -206,6 +206,13 @@ bool pinyin_load_phrase_library(pinyin_context_t * context, guint8 index){ if (!(index < PHRASE_INDEX_LIBRARY_COUNT)) return false; + + /* check whether the sub phrase index is already loaded. */ + PhraseIndexRange range; + int retval = context->m_phrase_index->get_range(index, range); + if (ERROR_OK == retval) + return false; + const pinyin_table_info_t * table_info = pinyin_phrase_files + index; if (SYSTEM_FILE == table_info->m_file_type) {