X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Ffind_speller.cpp;h=d83c73820f31fa0b6d0e5b73136b3be7a52a7888;hb=75afd441ce382779f81829919ca9e245cd4f3a02;hp=3ea469c54b194c1e20dbec16244d777d7e05a560;hpb=9889ee6712f8ca1e2a60c4b9747796244a8c6ebe;p=platform%2Fupstream%2Faspell.git diff --git a/lib/find_speller.cpp b/lib/find_speller.cpp index 3ea469c..d83c738 100644 --- a/lib/find_speller.cpp +++ b/lib/find_speller.cpp @@ -283,7 +283,7 @@ namespace acommon { PosibErr find_word_list(Config * c) { - Config * config = new_config(); + StackPtr config(new_config()); RET_ON_ERR(config->read_in_settings(c)); String dict_name; @@ -365,7 +365,8 @@ namespace acommon { else if (config->have("module-search-order")) config->retrieve_list("module-search-order", &b_module.list); { - StackPtr els(get_module_info_list(config)->elements()); + RET_ON_ERR_SET(get_module_info_list(config), const ModuleInfoList *, modules); + StackPtr els(modules->elements()); const ModuleInfo * entry; while ( (entry = els->next()) != 0) b_module.list.add(entry->name); @@ -384,7 +385,7 @@ namespace acommon { b_size.req_type = '+'; } if (!asc_isdigit(p[0]) || !asc_isdigit(p[1]) || p[2] != '\0') - abort(); //FIXME: create an error condition here + return make_err(aerror_bad_value, "size", str, "valid"); b_size.requested = atoi(p); b_size.init(); @@ -429,11 +430,7 @@ namespace acommon { // if (best != 0) { String main_wl,flags; - PosibErrBase ret = get_dict_file_name(best, main_wl, flags); - if (ret.has_err()) { - delete config; - return ret; - } + RET_ON_ERR(get_dict_file_name(best, main_wl, flags)); dict_name = best->name; config->replace("lang", b_code.best); config->replace("language-tag", b_code.best); @@ -449,7 +446,6 @@ namespace acommon { } config->replace("size", b_size.best_str); } else { - delete config; return make_err(no_wordlist_for_lang, code); } } @@ -457,7 +453,7 @@ namespace acommon { const StringMap * dict_aliases = get_dict_aliases(config); const char * val = dict_aliases->lookup(dict_name); if (val) config->replace("master", val); - return config; + return config.release(); } PosibErr reload_filters(Speller * m)