diff --git a/src/gui/base/msime_user_dictionary_importer.cc b/src/gui/base/msime_user_dictionary_importer.cc index 9e8160f5d4..48c748bbf5 100644 --- a/src/gui/base/msime_user_dictionary_importer.cc +++ b/src/gui/base/msime_user_dictionary_importer.cc @@ -132,11 +132,10 @@ class MSIMEImportIterator return; } - std::string name; for (int i = 0; i < pos_size; ++i) { - EncodingUtil::SjisToUtf8(reinterpret_cast(pos_table->szName), - &name); - pos_map_.insert(std::make_pair(pos_table->nPos, name)); + pos_map_.try_emplace(pos_table->nPos, + EncodingUtil::SjisToUtf8( + reinterpret_cast(pos_table->szName))); ++pos_table; } @@ -195,9 +194,8 @@ class MSIMEImportIterator // set comment if (buf_[index_].pvComment != nullptr) { if (buf_[index_].uct == IFED_UCT_STRING_SJIS) { - EncodingUtil::SjisToUtf8( - reinterpret_cast(buf_[index_].pvComment), - &entry->comment); + entry->comment = EncodingUtil::SjisToUtf8( + reinterpret_cast(buf_[index_].pvComment)); } else if (buf_[index_].uct == IFED_UCT_STRING_UNICODE) { Util::WideToUtf8( reinterpret_cast(buf_[index_].pvComment), diff --git a/src/gui/dictionary_tool/dictionary_tool.cc b/src/gui/dictionary_tool/dictionary_tool.cc index a19a70c7fd..ac86e76ac7 100644 --- a/src/gui/dictionary_tool/dictionary_tool.cc +++ b/src/gui/dictionary_tool/dictionary_tool.cc @@ -951,7 +951,6 @@ void DictionaryTool::ImportFromDefaultIME() { DCHECK(dic); const int old_size = dic->entries_size(); - const std::string dic_name = dic_info.item->text().toStdString(); UserDictionaryImporter::ErrorType error = UserDictionaryImporter::IMPORT_NOT_SUPPORTED; @@ -968,7 +967,7 @@ void DictionaryTool::ImportFromDefaultIME() { OnDictionarySelectionChanged(); UpdateUIStatus(); - ReportImportError(error, dic_name, added_entries_size); + ReportImportError(error, dic_info.item->text(), added_entries_size); #endif // _WIN32 }