From b4b9e9b1371a8aa16bbab99dfdb84608ead6507a Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 7 Nov 2012 13:05:48 +0800 Subject: fixes pinyin_load_phrase_library --- src/pinyin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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) { -- cgit