summaryrefslogtreecommitdiff
path: root/app-i18n/mozc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /app-i18n/mozc
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'app-i18n/mozc')
-rw-r--r--app-i18n/mozc/Manifest6
-rw-r--r--app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch1039
-rw-r--r--app-i18n/mozc/mozc-2.23.2815.102.ebuild5
-rw-r--r--app-i18n/mozc/mozc-9999.ebuild5
4 files changed, 9 insertions, 1046 deletions
diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index aaf623fbd9d7..1fa1415d0b4f 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -3,7 +3,6 @@ AUX mozc-2.20.2673.102-tests_build.patch 1037 BLAKE2B 8f3c0b3361371a994957a89f5b
AUX mozc-2.20.2673.102-tests_skipping.patch 2086 BLAKE2B a104d6a83b02b49e1208be1b39699b90ad419d8befa29ed0366f7cbc454fe9ce27361f21897a5c74dadfc2d9eb31a30d7237e20db8c1fb205b8e71b40f4a0e57 SHA512 4a2e5a35c5e65ebeb737f656d6efb313c660c2c7cf62abd5d9295fd16e2dffde21d069cd74fd0cfd2454cd7f7c9d136dfbadbf79832db8441c619ff37c7e4b0e
AUX mozc-2.23.2815.102-environmental_variables.patch 4636 BLAKE2B 2c1d952899b50d0205127fe5f708c8cc8ad115db35f1ebfe5b589550203ee64fe06b0d66b10989c12063feff96f679ebd6ee4562651ac81681019634e6e9c462 SHA512 40e87a52d96794a91f5cf77f387d341b7d58a4b27e3d1455c4230fbe75107c09c3bd4784394437265548ee2704a4d1838cc0965f0333e554484dafe8b106cb7b
AUX mozc-2.23.2815.102-gcc-8.patch 496 BLAKE2B 318fcda19cf4f7e95920b5df4f5638621bcae992891941fa6f220d4dac1b2eac0faeda7a857a587baed41b361608f20c4bbda0d9a69a60b823572482c6789f46 SHA512 9c2b0e9695f4cd050f0d5f35d0e23f22715b9c6e5607629c7dc023560a5191bd755497fe6fe5306789c00e68d5bd9b7179d5515c982967788fca432134b71cad
-AUX mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch 40296 BLAKE2B 982f43fa68031eb0f779ec4d034fef838a4fce7834291db889c9edffba3df4acd5bfdf187dd4a52ee8fd0714de943f9d5112070cd69502e1449dab4dbf8543b2 SHA512 6e05b2f22663ddbfb24a8344928ec24c0b4cf523728c1623367970b8f263142af95c056c82d0827414833d5b9f26c3a024a04a688851021601a5cbcc1474e754
AUX mozc-2.23.2815.102-python-3_1.patch 19991 BLAKE2B e553f5b3beb7a82f9f91f585a17004f96d9bb3883b432af2f4232211de3d8c4e348cf0d1327fe2e49410112540a01533068ca76464a7deb79429bfa7c49f58c8 SHA512 7d51f282fa3132d279b979ae96d2d7a1a3009c2ad96544033084deb0b739638ae69263b0067172a890d5ca3dd7e47f412af05b8f57ee64505a040cbdb77af388
AUX mozc-2.23.2815.102-python-3_2.patch 17794 BLAKE2B 53849d003e3821a6d07e5019d0defb9b4558f91938da2367e82cf5327d2c69e13107eb91b7c05b731e1693ca02ca1e61771b81c29d391e412a43fd0fe64973b8 SHA512 a8d017d9b5aa7c89638fcb464a016b8e98b2e20dacc0c68c4362824cad315e0c76c15cabce84059de4a3d2184c1388289f253ebd22f1c640a3946a1189955d72
AUX mozc-2.23.2815.102-python-3_3.patch 17011 BLAKE2B b7a40ec699da304130ab8b0e149d57ebc1b31c608c03fb35104918e0d33289eb5b40211a18f2083a2addcaed68b691ef2d029c106e2f2fec861f416a2e5f2134 SHA512 52b5cd4ee5e61582f2b9172a927e9e54bf07aea90462448fd63385c7be12c37b19cbdd784a21db3950ec4269249221f4f3bb3570ce0068d5a2448db63a33463c
@@ -13,7 +12,8 @@ AUX mozc-2.23.2815.102-server_path_check.patch 3447 BLAKE2B 8e18cf2f7100cdfeb8e6
AUX mozc-2.23.2815.102-system_libraries.patch 9064 BLAKE2B 0cdf732a1bbf16d4af1d6dee81aacf3f3cb1f1c00c6aeb0fc12dac9dcd8611124e388e5fc721eb9b9472e073515d7457b182ee7cfe466b83bf319d572ae55240 SHA512 2d5b06e855f8c1889367b9b672e3ec81a037bc592872e28319e0180a0dcd177cdff817775a1a0f74ebf48e0b7558cf3b67953120411be753c662c43f409b05ce
DIST fcitx-mozc-2.23.2815.102.1.patch 295112 BLAKE2B 709b84f6eaed16da38a173f40ae7cccff362fd167e6deb4090ae8a9ec522ac8e11ccff3c9ef6433907249af8c9eb4b7be12d2c05564cabd45c25e26764286ed3 SHA512 e0d4645df919838f0fe31a97bf6dd759c222a696f68133f7584d2c771f70734ea634a25bebb03a756221000d3552423207ee5163d75778dbf480b6e267ba4cd0
DIST japanese-usage-dictionary-20120416091336.tar.gz 71051 BLAKE2B 08eecf0aa021e27a2813f58c2d37f1cec760448f6ae086ae7468b8a11575c6ef9f72f656cb4d53e0179b8a7b00f2d91ff51a0ad7825e078dcbac0810f1d8b3e1 SHA512 b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7
+DIST mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch 40296 BLAKE2B 982f43fa68031eb0f779ec4d034fef838a4fce7834291db889c9edffba3df4acd5bfdf187dd4a52ee8fd0714de943f9d5112070cd69502e1449dab4dbf8543b2 SHA512 6e05b2f22663ddbfb24a8344928ec24c0b4cf523728c1623367970b8f263142af95c056c82d0827414833d5b9f26c3a024a04a688851021601a5cbcc1474e754
DIST mozc-2.23.2815.102.tar.gz 47739041 BLAKE2B 045a8a4a07e09cf923b67824111cdf672febc30256a6aef951ae779a3f582b3860042750d766120e376898c63be5b4baea870798a192cee34b0d48647e1ec5e6 SHA512 a3face616ca89990bca52371dcc8003604ebe0e9633116a64550add070152b1bc4d9b21e9f102c5afa6f8b1aa11d8dbc4bafbcebfaf4a12a934f085f245d548f
-EBUILD mozc-2.23.2815.102.ebuild 11134 BLAKE2B f5569a3a225216f6e34021d888664169e3fd07cc1faeceb7e64a46581e9a17b56e700e0c282ebcc1de5d163cebe2a9ecd67835937b38e96decae9851f865445e SHA512 4740d3ab5421017067db1886320ba4563ebbe159335ee92748507692861d256bc5b9d21bda3341b6877c35f968fc8e7c5e43b3a215f600fc477339b167c9e7c7
-EBUILD mozc-9999.ebuild 10967 BLAKE2B e6e857970fa7e9dfc191328fe84df1f5b5829e63878579049f56bce2cd8abfcc655078d7ff4a09c0c8ae8d1656385fdebc4a73e36ad6c3b8e7bf286dac27d7ae SHA512 21877036de3d1630bd9d1aa9a369111442b1c40a641f8ddbab0c745f9749d9dc8ecf90af084e88170b2786985f0c4ea5adadf802637390cdc9ee3bb67754ac17
+EBUILD mozc-2.23.2815.102.ebuild 11247 BLAKE2B 6df0d12985da09fd920250c98a65e3fc4957ce6eefa9105fcee0f02e6f9ec49d8de629bae5ad08729bedc95138679f7887d986d027b0ae62c7ec5661fd6e281c SHA512 e4983c41c4623c2c8015d005af8ba261857caa0c5852b69af1640619e94e9f4e5f1c72a992831aa88b9bafa57d49ef0c049d9c3a14a6a495172578401f93072d
+EBUILD mozc-9999.ebuild 11080 BLAKE2B a38a04853549491d1fb431bb3cdc7fcb55aa5593aea513bef3268e00f3e6dfaa4e64e1e6e5191634f9bf03dd1395289fdb309a33fe76609c0164c54848f74798 SHA512 435233f85519815fb761a488c99f3e757c89a42a95d0ff35c80b2c359d8a0434c1aa656c5d8b90b8b1561521d4207e2773910e161a6f3d297728fc3d64b551f3
MISC metadata.xml 1001 BLAKE2B cbbb63e46d6b9cca2c1c5d08dcfeacc8fe82910a0a7398a9060a2ccd06d395765865674b1c66c72cdb9c71d5984b8d0a05a2784052219a6d6af2e0da175e65ac SHA512 98b86d4e51b43d95f7d647cf2cb57ed2a8a7e1b20042a60bae7e56d82596e2f94b2d57cb9dfbf45ae5e2a5a19e78f335e89a8e724424b8fc04f21d344c4e2c75
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
deleted file mode 100644
index 2cd757281545..000000000000
--- a/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
+++ /dev/null
@@ -1,1039 +0,0 @@
-https://github.com/google/mozc/issues/460
-
---- /src/dictionary/user_dictionary.cc
-+++ /src/dictionary/user_dictionary.cc
-@@ -289,7 +289,7 @@
- }
-
- auto_register_mode_ = false;
-- dic_->Load(*(storage.get()));
-+ dic_->Load(storage.get()->user_dictionary_storage_base);
- }
-
- private:
---- /src/dictionary/user_dictionary_session.cc
-+++ /src/dictionary/user_dictionary_session.cc
-@@ -69,11 +69,11 @@
- }
-
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
-- if (storage->dictionaries_size() == 0) {
-+ if (storage->user_dictionary_storage_base.dictionaries_size() == 0) {
- return false;
- }
-
-- storage->mutable_dictionaries()->RemoveLast();
-+ storage->user_dictionary_storage_base.mutable_dictionaries()->RemoveLast();
- return true;
- }
-
-@@ -94,7 +94,7 @@
- }
-
- RepeatedPtrField<UserDictionary> *dictionaries =
-- storage->mutable_dictionaries();
-+ storage->user_dictionary_storage_base.mutable_dictionaries();
- dictionaries->AddAllocated(dictionary_.release());
-
- // Adjust the position of the reverted dictionary.
-@@ -120,10 +120,10 @@
- }
-
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
-- if (storage->dictionaries_size() != 1) {
-+ if (storage->user_dictionary_storage_base.dictionaries_size() != 1) {
- return false;
- }
-- dictionary_->Swap(storage->mutable_dictionaries(0));
-+ dictionary_->Swap(storage->user_dictionary_storage_base.mutable_dictionaries(0));
- return true;
- }
-
-@@ -144,7 +144,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL) {
- return false;
- }
-@@ -169,7 +169,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL || dictionary->entries_size() == 0) {
- return false;
- }
-@@ -195,7 +195,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL ||
- index_ < 0 || dictionary->entries_size() <= index_) {
- return false;
-@@ -240,7 +240,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL) {
- return false;
- }
-@@ -306,7 +306,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL) {
- return false;
- }
-@@ -345,7 +345,7 @@
-
- // TODO(hidehiko) move this to header.
- const UserDictionaryStorage &UserDictionarySession::storage() const {
-- return *storage_;
-+ return storage_->user_dictionary_storage_base;
- }
- mozc::UserDictionaryStorage *UserDictionarySession::mutable_storage() {
- return storage_.get();
-@@ -464,7 +464,7 @@
- const string &dictionary_name, uint64 *new_dictionary_id) {
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::CreateDictionary(
-- storage_.get(), dictionary_name, new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_name, new_dictionary_id);
- if (status == UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
- AddUndoCommand(new UndoCreateDictionaryCommand);
- }
-@@ -488,7 +488,7 @@
- int original_index;
- UserDictionary *deleted_dictionary;
- if (!UserDictionaryUtil::DeleteDictionary(
-- storage_.get(), dictionary_id,
-+ &storage_->user_dictionary_storage_base, dictionary_id,
- &original_index, &deleted_dictionary)) {
- // Failed to delete the dictionary.
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
-@@ -510,7 +510,7 @@
- uint64 dictionary_id, const string &dictionary_name) {
- string original_name;
- const UserDictionary *dictionary =
-- UserDictionaryUtil::GetUserDictionaryById(*storage_, dictionary_id);
-+ UserDictionaryUtil::GetUserDictionaryById(storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary != NULL) {
- // Note that if dictionary is null, it means the dictionary_id is invalid
- // so following RenameDictionary will fail, and error handling is done
-@@ -547,7 +547,7 @@
- uint64 dictionary_id, const UserDictionary::Entry &entry) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -575,7 +575,7 @@
- uint64 dictionary_id, int index, const UserDictionary::Entry &entry) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -604,7 +604,7 @@
- uint64 dictionary_id, const std::vector<int> &index_list) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -644,7 +644,7 @@
- uint64 dictionary_id, const string &data) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -699,7 +699,7 @@
- uint64 *new_dictionary_id) {
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::CreateDictionary(
-- storage_.get(), dictionary_name, new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_name, new_dictionary_id);
- if (status != UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
- return status;
- }
-@@ -709,7 +709,7 @@
-
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), *new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, *new_dictionary_id);
- if (dictionary == NULL) {
- // The dictionary should be always found.
- return UserDictionaryCommandStatus::UNKNOWN_ERROR;
-@@ -719,7 +719,7 @@
- }
-
- bool UserDictionarySession::EnsureNonEmptyStorage() {
-- if (storage_->dictionaries_size() > 0) {
-+ if (storage_->user_dictionary_storage_base.dictionaries_size() > 0) {
- // The storage already has at least one dictionary. Do nothing.
- return false;
- }
-@@ -728,7 +728,7 @@
- uint64 new_dictionary_id;
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::CreateDictionary(
-- storage_.get(), default_dictionary_name_, &new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, default_dictionary_name_, &new_dictionary_id);
- CHECK_EQ(
- status, UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS);
- return true;
-@@ -755,7 +755,7 @@
-
- void UserDictionarySession::ClearDictionariesAndUndoHistory() {
- ScopedUserDictionaryLocker l(storage_.get());
-- storage_->clear_dictionaries();
-+ storage_->user_dictionary_storage_base.clear_dictionaries();
- ClearUndoHistory();
- }
-
---- /src/dictionary/user_dictionary_session_test.cc
-+++ /src/dictionary/user_dictionary_session_test.cc
-@@ -95,12 +95,12 @@
-
- ASSERT_EQ(UserDictionaryCommandStatus::FILE_NOT_FOUND, session.Load());
-
-- session.mutable_storage()->set_version(10);
-+ session.mutable_storage()->user_dictionary_storage_base.set_version(10);
- ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
- session.Save());
-
- // Clear once, in order to make sure that Load is actually working.
-- session.mutable_storage()->Clear();
-+ session.mutable_storage()->user_dictionary_storage_base.Clear();
- ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
- session.Load());
-
-@@ -130,7 +130,7 @@
-
- // Create huge dummy data.
- {
-- UserDictionaryStorage *storage = session.mutable_storage();
-+ UserDictionaryStorage *storage = &session.mutable_storage()->user_dictionary_storage_base;
- for (int i = 0; i < 100; ++i) {
- UserDictionary *dictionary = storage->add_dictionaries();
- for (int j = 0; j < 1000; ++j) {
-@@ -147,7 +147,7 @@
- ASSERT_EQ(UserDictionaryCommandStatus::FILE_SIZE_LIMIT_EXCEEDED,
- session.Save());
-
-- session.mutable_storage()->Clear();
-+ session.mutable_storage()->user_dictionary_storage_base.Clear();
- ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
- session.Load());
-
-@@ -191,7 +191,7 @@
-
- while (session.storage().dictionaries_size() <
- ::mozc::UserDictionaryStorage::max_dictionary_size()) {
-- session.mutable_storage()->add_dictionaries();
-+ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
- }
- EXPECT_EQ(UserDictionaryCommandStatus::DICTIONARY_SIZE_LIMIT_EXCEEDED,
- session.CreateDictionary("dictionary 2", &dummy_dictionary_id));
-@@ -204,7 +204,7 @@
- const uint64 kDummyId = 10;
- {
- UserDictionary *user_dictionary =
-- session.mutable_storage()->add_dictionaries();
-+ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
- user_dictionary->set_id(kDummyId);
- }
-
-@@ -229,7 +229,7 @@
- const uint64 kDummyId = 10;
- {
- UserDictionary *user_dictionary =
-- session.mutable_storage()->add_dictionaries();
-+ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
- user_dictionary->set_id(kDummyId);
- }
-
---- /src/dictionary/user_dictionary_storage.cc
-+++ /src/dictionary/user_dictionary_storage.cc
-@@ -109,7 +109,7 @@
- mozc::protobuf::io::IstreamInputStream zero_copy_input(&ifs);
- mozc::protobuf::io::CodedInputStream decoder(&zero_copy_input);
- decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit, -1);
-- if (!ParseFromCodedStream(&decoder)) {
-+ if (!user_dictionary_storage_base.ParseFromCodedStream(&decoder)) {
- LOG(ERROR) << "Failed to parse";
- if (!decoder.ConsumedEntireMessage() || !ifs.eof()) {
- LOG(ERROR) << "ParseFromStream failed: file seems broken";
-@@ -137,11 +137,11 @@
- }
-
- // Check dictionary id here. if id is 0, assign random ID.
-- for (int i = 0; i < dictionaries_size(); ++i) {
-- const UserDictionary &dict = dictionaries(i);
-+ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ const UserDictionary &dict = user_dictionary_storage_base.dictionaries(i);
- if (dict.id() == 0) {
-- mutable_dictionaries(i)->set_id(
-- UserDictionaryUtil::CreateNewDictionaryId(*this));
-+ user_dictionary_storage_base.mutable_dictionaries(i)->set_id(
-+ UserDictionaryUtil::CreateNewDictionaryId(this->user_dictionary_storage_base));
- }
- }
-
-@@ -171,7 +171,7 @@
- return false;
- }
-
-- if (!SerializeToOstream(&ofs)) {
-+ if (!user_dictionary_storage_base.SerializeToOstream(&ofs)) {
- LOG(ERROR) << "SerializeToString failed";
- last_error_type_ = SYNC_FAILURE;
- return false;
-@@ -227,7 +227,7 @@
- return false;
- }
-
-- const UserDictionary &dic = dictionaries(index);
-+ const UserDictionary &dic = user_dictionary_storage_base.dictionaries(index);
- for (size_t i = 0; i < dic.entries_size(); ++i) {
- const UserDictionaryEntry &entry = dic.entries(i);
- ofs << entry.key() << "\t" << entry.value() << "\t"
-@@ -241,7 +241,7 @@
- bool UserDictionaryStorage::CreateDictionary(
- const string &dic_name, uint64 *new_dic_id) {
- UserDictionaryCommandStatus::Status status =
-- UserDictionaryUtil::CreateDictionary(this, dic_name, new_dic_id);
-+ UserDictionaryUtil::CreateDictionary(&this->user_dictionary_storage_base, dic_name, new_dic_id);
- // Update last_error_type_
- switch (status) {
- case UserDictionaryCommandStatus::DICTIONARY_NAME_EMPTY:
-@@ -273,7 +273,7 @@
- }
-
- bool UserDictionaryStorage::DeleteDictionary(uint64 dic_id) {
-- if (!UserDictionaryUtil::DeleteDictionary(this, dic_id, NULL, NULL)) {
-+ if (!UserDictionaryUtil::DeleteDictionary(&this->user_dictionary_storage_base, dic_id, NULL, NULL)) {
- // Failed to delete dictionary.
- last_error_type_ = INVALID_DICTIONARY_ID;
- return false;
-@@ -304,8 +304,8 @@
- return true;
- }
-
-- for (int i = 0; i < dictionaries_size(); ++i) {
-- if (dic_name == dictionaries(i).name()) {
-+ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ if (dic_name == user_dictionary_storage_base.dictionaries(i).name()) {
- last_error_type_ = DUPLICATED_DICTIONARY_NAME;
- LOG(ERROR) << "duplicated dictionary name";
- return false;
-@@ -318,14 +318,14 @@
- }
-
- int UserDictionaryStorage::GetUserDictionaryIndex(uint64 dic_id) const {
-- return UserDictionaryUtil::GetUserDictionaryIndexById(*this, dic_id);
-+ return UserDictionaryUtil::GetUserDictionaryIndexById(this->user_dictionary_storage_base, dic_id);
- }
-
- bool UserDictionaryStorage::GetUserDictionaryId(const string &dic_name,
- uint64 *dic_id) {
-- for (size_t i = 0; i < dictionaries_size(); ++i) {
-- if (dic_name == dictionaries(i).name()) {
-- *dic_id = dictionaries(i).id();
-+ for (size_t i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ if (dic_name == user_dictionary_storage_base.dictionaries(i).name()) {
-+ *dic_id = user_dictionary_storage_base.dictionaries(i).id();
- return true;
- }
- }
-@@ -335,7 +335,7 @@
-
- user_dictionary::UserDictionary *UserDictionaryStorage::GetUserDictionary(
- uint64 dic_id) {
-- return UserDictionaryUtil::GetMutableUserDictionaryById(this, dic_id);
-+ return UserDictionaryUtil::GetMutableUserDictionaryById(&this->user_dictionary_storage_base, dic_id);
- }
-
- UserDictionaryStorage::UserDictionaryStorageErrorType
-@@ -352,8 +352,8 @@
- }
-
- int auto_index = -1;
-- for (int i = 0; i < dictionaries_size(); ++i) {
-- if (dictionaries(i).name() == kAutoRegisteredDictionaryName) {
-+ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ if (user_dictionary_storage_base.dictionaries(i).name() == kAutoRegisteredDictionaryName) {
- auto_index = i;
- break;
- }
-@@ -361,17 +361,17 @@
-
- UserDictionary *dic = NULL;
- if (auto_index == -1) {
-- if (UserDictionaryUtil::IsStorageFull(*this)) {
-+ if (UserDictionaryUtil::IsStorageFull(this->user_dictionary_storage_base)) {
- last_error_type_ = TOO_MANY_DICTIONARIES;
- LOG(ERROR) << "too many dictionaries";
- UnLock();
- return false;
- }
-- dic = add_dictionaries();
-- dic->set_id(UserDictionaryUtil::CreateNewDictionaryId(*this));
-+ dic = user_dictionary_storage_base.add_dictionaries();
-+ dic->set_id(UserDictionaryUtil::CreateNewDictionaryId(this->user_dictionary_storage_base));
- dic->set_name(kAutoRegisteredDictionaryName);
- } else {
-- dic = mutable_dictionaries(auto_index);
-+ dic = user_dictionary_storage_base.mutable_dictionaries(auto_index);
- }
-
- if (dic == NULL) {
-@@ -410,13 +410,13 @@
- }
-
- bool UserDictionaryStorage::ConvertSyncDictionariesToNormalDictionaries() {
-- if (CountSyncableDictionaries(*this) == 0) {
-+ if (CountSyncableDictionaries(this->user_dictionary_storage_base) == 0) {
- return false;
- }
-
-- for (int dictionary_index = dictionaries_size() - 1;
-+ for (int dictionary_index = user_dictionary_storage_base.dictionaries_size() - 1;
- dictionary_index >= 0; --dictionary_index) {
-- UserDictionary *dic = mutable_dictionaries(dictionary_index);
-+ UserDictionary *dic = user_dictionary_storage_base.mutable_dictionaries(dictionary_index);
- if (!dic->syncable()) {
- continue;
- }
-@@ -433,10 +433,10 @@
-
- // Delete removed or unused sync dictionaries.
- if (dic->removed() || dic->entries_size() == 0) {
-- for (int i = dictionary_index + 1; i < dictionaries_size(); ++i) {
-- mutable_dictionaries()->SwapElements(i - 1, i);
-+ for (int i = dictionary_index + 1; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ user_dictionary_storage_base.mutable_dictionaries()->SwapElements(i - 1, i);
- }
-- mutable_dictionaries()->RemoveLast();
-+ user_dictionary_storage_base.mutable_dictionaries()->RemoveLast();
- continue;
- }
-
-@@ -445,7 +445,7 @@
- kDictionaryNameConvertedFromSyncableDictionary;
- int index = 0;
- while (UserDictionaryUtil::ValidateDictionaryName(
-- *this, new_dictionary_name)
-+ this->user_dictionary_storage_base, new_dictionary_name)
- != UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
- ++index;
- new_dictionary_name = Util::StringPrintf(
-@@ -456,7 +456,7 @@
- dic->set_syncable(false);
- }
-
-- DCHECK_EQ(0, CountSyncableDictionaries(*this));
-+ DCHECK_EQ(0, CountSyncableDictionaries(this->user_dictionary_storage_base));
-
- return true;
- }
-@@ -487,7 +487,7 @@
- bool UserDictionaryStorage::IsValidDictionaryName(const string &name) {
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::ValidateDictionaryName(
-- UserDictionaryStorage::default_instance(), name);
-+ user_dictionary::UserDictionaryStorage::default_instance(), name);
-
- // Update last_error_type_.
- switch (status) {
---- /src/dictionary/user_dictionary_storage.h
-+++ /src/dictionary/user_dictionary_storage.h
-@@ -72,13 +72,15 @@
- class Mutex;
- class ProcessMutex;
-
--// Inherit from ProtocolBuffer
--// TODO(hidehiko): Get rid of this implementation.
--class UserDictionaryStorage : public user_dictionary::UserDictionaryStorage {
-+class UserDictionaryStorage {
- public:
- typedef user_dictionary::UserDictionary UserDictionary;
- typedef user_dictionary::UserDictionary::Entry UserDictionaryEntry;
-
-+ // Instance of base class generated by Protocol Buffers compiler.
-+ // Regular inheritance strongly discouraged.
-+ user_dictionary::UserDictionaryStorage user_dictionary_storage_base;
-+
- enum UserDictionaryStorageErrorType {
- USER_DICTIONARY_STORAGE_NO_ERROR = 0, // default
- FILE_NOT_EXISTS,
---- /src/dictionary/user_dictionary_storage_test.cc
-+++ /src/dictionary/user_dictionary_storage_test.cc
-@@ -118,13 +118,13 @@
- const size_t kDictionariesSize = 3;
- uint64 id[kDictionariesSize];
-
-- const size_t dict_size = storage.dictionaries_size();
-+ const size_t dict_size = storage.user_dictionary_storage_base.dictionaries_size();
-
- for (size_t i = 0; i < kDictionariesSize; ++i) {
- EXPECT_TRUE(storage.CreateDictionary(
- "test" + std::to_string(static_cast<uint32>(i)),
- &id[i]));
-- EXPECT_EQ(i + 1 + dict_size, storage.dictionaries_size());
-+ EXPECT_EQ(i + 1 + dict_size, storage.user_dictionary_storage_base.dictionaries_size());
- }
-
- for (size_t i = 0; i < kDictionariesSize; ++i) {
-@@ -133,7 +133,7 @@
- }
-
- for (size_t i = 0; i < kDictionariesSize; ++i) {
-- EXPECT_EQ(storage.mutable_dictionaries(i + dict_size),
-+ EXPECT_EQ(storage.user_dictionary_storage_base.mutable_dictionaries(i + dict_size),
- storage.GetUserDictionary(id[i]));
- EXPECT_EQ(NULL, storage.GetUserDictionary(id[i] + 1));
- }
-@@ -165,7 +165,7 @@
- EXPECT_FALSE(storage.DeleteDictionary(0));
-
- EXPECT_TRUE(storage.DeleteDictionary(id[1]));
-- EXPECT_EQ(kDictionariesSize + dict_size - 1, storage.dictionaries_size());
-+ EXPECT_EQ(kDictionariesSize + dict_size - 1, storage.user_dictionary_storage_base.dictionaries_size());
- }
-
- TEST_F(UserDictionaryStorageTest, DeleteTest) {
-@@ -174,7 +174,7 @@
-
- // repeat 10 times
- for (int i = 0; i < 10; ++i) {
-- storage.Clear();
-+ storage.user_dictionary_storage_base.Clear();
- std::vector<uint64> ids(100);
- for (size_t i = 0; i < ids.size(); ++i) {
- EXPECT_TRUE(storage.CreateDictionary(
-@@ -191,10 +191,10 @@
- alive.push_back(ids[i]);
- }
-
-- EXPECT_EQ(alive.size(), storage.dictionaries_size());
-+ EXPECT_EQ(alive.size(), storage.user_dictionary_storage_base.dictionaries_size());
-
- for (size_t i = 0; i < alive.size(); ++i) {
-- EXPECT_EQ(alive[i], storage.dictionaries(i).id());
-+ EXPECT_EQ(alive[i], storage.user_dictionary_storage_base.dictionaries(i).id());
- }
- }
- }
-@@ -268,7 +268,7 @@
- const size_t entry_size = Util::Random(100) + 1;
- for (size_t j = 0; j < entry_size; ++j) {
- UserDictionaryStorage::UserDictionary *dic =
-- storage1.mutable_dictionaries(i);
-+ storage1.user_dictionary_storage_base.mutable_dictionaries(i);
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
- entry->set_key(GenRandomString(10));
-@@ -288,7 +288,7 @@
- EXPECT_TRUE(storage2.Load());
- }
-
-- EXPECT_EQ(storage1.DebugString(), storage2.DebugString());
-+ EXPECT_EQ(storage1.user_dictionary_storage_base.DebugString(), storage2.user_dictionary_storage_base.DebugString());
- }
- }
-
-@@ -352,7 +352,7 @@
- uint64 dict_id = 0;
- ASSERT_TRUE(storage.CreateDictionary(data.dictionary_name, &dict_id));
- UserDictionaryStorage::UserDictionary *dict =
-- storage.mutable_dictionaries(storage.GetUserDictionaryIndex(dict_id));
-+ storage.user_dictionary_storage_base.mutable_dictionaries(storage.GetUserDictionaryIndex(dict_id));
- dict->set_syncable(data.is_sync_dictionary);
- dict->set_removed(data.is_removed_dictionary);
- if (data.has_normal_entry) {
-@@ -369,7 +369,7 @@
- entry->set_removed(true);
- }
- }
-- EXPECT_EQ(9, UserDictionaryStorage::CountSyncableDictionaries(storage));
-+ EXPECT_EQ(9, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
-
- ASSERT_TRUE(storage.ConvertSyncDictionariesToNormalDictionaries());
-
-@@ -385,12 +385,12 @@
- { true, kDictionaryNameConvertedFromSyncableDictionary },
- };
-
-- EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage));
-- ASSERT_EQ(arraysize(expected_data), storage.dictionaries_size());
-+ EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
-+ ASSERT_EQ(arraysize(expected_data), storage.user_dictionary_storage_base.dictionaries_size());
- for (size_t i = 0; i < arraysize(expected_data); ++i) {
- SCOPED_TRACE(Util::StringPrintf("verify %d", static_cast<int>(i)));
- const ExpectedData &expected = expected_data[i];
-- const UserDictionaryStorage::UserDictionary &dict = storage.dictionaries(i);
-+ const UserDictionaryStorage::UserDictionary &dict = storage.user_dictionary_storage_base.dictionaries(i);
-
- EXPECT_EQ(expected.dictionary_name, dict.name());
- EXPECT_FALSE(dict.syncable());
-@@ -404,42 +404,42 @@
- }
-
- // Test duplicated dictionary name.
-- storage.Clear();
-+ storage.user_dictionary_storage_base.Clear();
- {
- uint64 dict_id = 0;
- storage.CreateDictionary(
- UserDictionaryStorage::default_sync_dictionary_name(), &dict_id);
- storage.CreateDictionary(
- kDictionaryNameConvertedFromSyncableDictionary, &dict_id);
-- ASSERT_EQ(2, storage.dictionaries_size());
-+ ASSERT_EQ(2, storage.user_dictionary_storage_base.dictionaries_size());
- UserDictionaryStorage::UserDictionary *dict;
-- dict = storage.mutable_dictionaries(0);
-+ dict = storage.user_dictionary_storage_base.mutable_dictionaries(0);
- dict->set_syncable(true);
- dict->add_entries()->set_key("0");
-- dict = storage.mutable_dictionaries(1);
-+ dict = storage.user_dictionary_storage_base.mutable_dictionaries(1);
- dict->set_syncable(false);
- dict->add_entries()->set_key("1");
- }
- ASSERT_TRUE(storage.ConvertSyncDictionariesToNormalDictionaries());
-- EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage));
-- EXPECT_EQ(2, storage.dictionaries_size());
-+ EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
-+ EXPECT_EQ(2, storage.user_dictionary_storage_base.dictionaries_size());
- EXPECT_EQ(Util::StringPrintf("%s_1",
- kDictionaryNameConvertedFromSyncableDictionary),
-- storage.dictionaries(0).name());
-+ storage.user_dictionary_storage_base.dictionaries(0).name());
- EXPECT_EQ(kDictionaryNameConvertedFromSyncableDictionary,
-- storage.dictionaries(1).name());
-+ storage.user_dictionary_storage_base.dictionaries(1).name());
- }
-
- TEST_F(UserDictionaryStorageTest, AddToAutoRegisteredDictionary) {
- {
- UserDictionaryStorage storage(GetUserDictionaryFile());
-- EXPECT_EQ(0, storage.dictionaries_size());
-+ EXPECT_EQ(0, storage.user_dictionary_storage_base.dictionaries_size());
- EXPECT_TRUE(storage.AddToAutoRegisteredDictionary(
- "key1", "value1", UserDictionary::NOUN));
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(1, storage.dictionaries(0).entries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
- const UserDictionaryStorage::UserDictionaryEntry &entry1 =
-- storage.dictionaries(0).entries(0);
-+ storage.user_dictionary_storage_base.dictionaries(0).entries(0);
- EXPECT_EQ("key1", entry1.key());
- EXPECT_EQ("value1", entry1.value());
- EXPECT_EQ(UserDictionary::NOUN, entry1.pos());
-@@ -447,10 +447,10 @@
-
- EXPECT_TRUE(storage.AddToAutoRegisteredDictionary(
- "key2", "value2", UserDictionary::NOUN));
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(2, storage.dictionaries(0).entries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(2, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
- const UserDictionaryStorage::UserDictionaryEntry &entry2 =
-- storage.dictionaries(0).entries(1);
-+ storage.user_dictionary_storage_base.dictionaries(0).entries(1);
- EXPECT_EQ("key2", entry2.key());
- EXPECT_EQ("value2", entry2.value());
- EXPECT_EQ(UserDictionary::NOUN, entry2.pos());
-@@ -474,7 +474,7 @@
- {
- UserDictionaryStorage storage(GetUserDictionaryFile());
- {
-- UserDictionary *dictionary = storage.add_dictionaries();
-+ UserDictionary *dictionary = storage.user_dictionary_storage_base.add_dictionaries();
- dictionary->set_id(kDummyDictionaryId);
- UserDictionary::Entry *entry = dictionary->add_entries();
- entry->set_key("key");
---- /src/dictionary/user_dictionary_test.cc
-+++ /src/dictionary/user_dictionary_test.cc
-@@ -334,9 +334,9 @@
- std::istringstream is(contents);
- CHECK(is.good());
-
-- storage->Clear();
-+ storage->user_dictionary_storage_base.Clear();
- UserDictionaryStorage::UserDictionary *dic
-- = storage->add_dictionaries();
-+ = storage->user_dictionary_storage_base.add_dictionaries();
- CHECK(dic);
-
- string line;
-@@ -389,7 +389,7 @@
- {
- UserDictionaryStorage storage("");
- UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup operation.
-@@ -425,7 +425,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary1, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup again.
-@@ -450,7 +450,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup operation.
-@@ -480,7 +480,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary1, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup.
-@@ -504,7 +504,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup operation.
-@@ -540,7 +540,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
-
- // "名詞"
- UserDictionaryStorage::UserDictionaryEntry *entry =
-@@ -555,7 +555,7 @@
- entry->set_value("suggest_only");
- entry->set_pos(user_dictionary::UserDictionary::SUGGESTION_ONLY);
-
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- }
-
- // "suggestion_only" should not be looked up.
-@@ -577,7 +577,7 @@
- {
- UserDictionaryStorage storage("");
- UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- TestLookupPrefixHelper(nullptr, 0, "start", 4, *dic);
-@@ -612,7 +612,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
- for (size_t j = 0; j < 10000; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
-@@ -681,15 +681,15 @@
- UserDictionaryStorage storage(filename);
- EXPECT_TRUE(storage.Load());
- int index = 0;
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(100, storage.dictionaries(index).entries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(100, storage.user_dictionary_storage_base.dictionaries(index).entries_size());
- for (int i = 0; i < 100; ++i) {
- EXPECT_EQ("key" + std::to_string(i),
-- storage.dictionaries(index).entries(i).key());
-+ storage.user_dictionary_storage_base.dictionaries(index).entries(i).key());
- EXPECT_EQ("value" + std::to_string(i),
-- storage.dictionaries(index).entries(i).value());
-+ storage.user_dictionary_storage_base.dictionaries(index).entries(i).value());
- EXPECT_EQ(user_dictionary::UserDictionary::NOUN,
-- storage.dictionaries(index).entries(i).pos());
-+ storage.user_dictionary_storage_base.dictionaries(index).entries(i).pos());
- }
- }
-
-@@ -722,12 +722,12 @@
- {
- UserDictionaryStorage storage(filename);
- EXPECT_TRUE(storage.Load());
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(1, storage.dictionaries(0).entries_size());
-- EXPECT_EQ("key", storage.dictionaries(0).entries(0).key());
-- EXPECT_EQ("value", storage.dictionaries(0).entries(0).value());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
-+ EXPECT_EQ("key", storage.user_dictionary_storage_base.dictionaries(0).entries(0).key());
-+ EXPECT_EQ("value", storage.user_dictionary_storage_base.dictionaries(0).entries(0).value());
- EXPECT_EQ(user_dictionary::UserDictionary::NOUN,
-- storage.dictionaries(0).entries(0).pos());
-+ storage.user_dictionary_storage_base.dictionaries(0).entries(0).pos());
- }
- }
-
-@@ -746,7 +746,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
- for (size_t j = 0; j < 10000; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
-@@ -770,7 +770,7 @@
-
- suppression_dictionary_->Lock();
- EXPECT_TRUE(suppression_dictionary_->IsLocked());
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- EXPECT_FALSE(suppression_dictionary_->IsLocked());
-
- for (size_t j = 0; j < 10; ++j) {
-@@ -782,11 +782,11 @@
-
- // Remove suppression entry
- {
-- storage.Clear();
-+ storage.user_dictionary_storage_base.Clear();
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
- for (size_t j = 0; j < 10000; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
-@@ -798,7 +798,7 @@
- }
-
- suppression_dictionary_->Lock();
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- EXPECT_FALSE(suppression_dictionary_->IsLocked());
-
- for (size_t j = 0; j < 10; ++j) {
-@@ -825,7 +825,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
-
- for (size_t j = 0; j < 10; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
-@@ -845,7 +845,7 @@
- entry->set_pos(user_dictionary::UserDictionary::SUGGESTION_ONLY);
- }
-
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- }
-
- {
-@@ -878,7 +878,7 @@
- UserDictionaryStorage storage("");
-
- {
-- UserDictionaryStorage::UserDictionary *dic1 = storage.add_dictionaries();
-+ UserDictionaryStorage::UserDictionary *dic1 = storage.user_dictionary_storage_base.add_dictionaries();
- CHECK(dic1);
- UserDictionaryStorage::UserDictionaryEntry *entry;
- entry = dic1->add_entries();
-@@ -893,7 +893,7 @@
- entry->set_pos(user_dictionary::UserDictionary::NOUN);
- }
- {
-- UserDictionaryStorage::UserDictionary *dic2 = storage.add_dictionaries();
-+ UserDictionaryStorage::UserDictionary *dic2 = storage.user_dictionary_storage_base.add_dictionaries();
- CHECK(dic2);
- UserDictionaryStorage::UserDictionaryEntry *entry;
- entry = dic2->add_entries();
-@@ -912,7 +912,7 @@
- entry->set_value("value5");
- entry->set_pos(user_dictionary::UserDictionary::NOUN);
- }
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
-
- EXPECT_INTEGER_STATS("UserRegisteredWord", 5);
- }
-@@ -925,7 +925,7 @@
- {
- UserDictionaryStorage storage("");
- UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // Entry is in user dictionary but has no comment.
---- /src/gui/word_register_dialog/word_register_dialog.cc
-+++ /src/gui/word_register_dialog/word_register_dialog.cc
-@@ -298,7 +298,7 @@
- }
-
- UserDictionary *dic =
-- session_->mutable_storage()->mutable_dictionaries(index);
-+ session_->mutable_storage()->user_dictionary_storage_base.mutable_dictionaries(index);
- CHECK(dic);
-
- if (dic->name() != DictionarycomboBox->currentText().toStdString()) {
---- /src/prediction/user_history_predictor.cc
-+++ /src/prediction/user_history_predictor.cc
-@@ -291,23 +291,23 @@
- return false;
- }
-
-- if (!ParseFromString(input)) {
-+ if (!user_history_base.ParseFromString(input)) {
- LOG(ERROR) << "ParseFromString failed. message looks broken";
- return false;
- }
-
-- VLOG(1) << "Loaded user histroy, size=" << entries_size();
-+ VLOG(1) << "Loaded user histroy, size=" << user_history_base.entries_size();
- return true;
- }
-
- bool UserHistoryStorage::Save() const {
-- if (entries_size() == 0) {
-+ if (user_history_base.entries_size() == 0) {
- LOG(WARNING) << "etries size is 0. Not saved";
- return false;
- }
-
- string output;
-- if (!AppendToString(&output)) {
-+ if (!user_history_base.AppendToString(&output)) {
- LOG(ERROR) << "AppendToString failed";
- return false;
- }
-@@ -494,12 +494,12 @@
- return false;
- }
-
-- for (size_t i = 0; i < history.entries_size(); ++i) {
-- dic_->Insert(EntryFingerprint(history.entries(i)),
-- history.entries(i));
-+ for (size_t i = 0; i < history.user_history_base.entries_size(); ++i) {
-+ dic_->Insert(EntryFingerprint(history.user_history_base.entries(i)),
-+ history.user_history_base.entries(i));
- }
-
-- VLOG(1) << "Loaded user histroy, size=" << history.entries_size();
-+ VLOG(1) << "Loaded user histroy, size=" << history.user_history_base.entries_size();
-
- return true;
- }
-@@ -521,13 +521,13 @@
-
- UserHistoryStorage history(filename);
- for (const DicElement *elm = tail; elm != nullptr; elm = elm->prev) {
-- history.add_entries()->CopyFrom(elm->value);
-+ history.user_history_base.add_entries()->CopyFrom(elm->value);
- }
-
- // Updates usage stats here.
- UsageStats::SetInteger(
- "UserHistoryPredictorEntrySize",
-- static_cast<int>(history.entries_size()));
-+ static_cast<int>(history.user_history_base.entries_size()));
-
- if (!history.Save()) {
- LOG(ERROR) << "UserHistoryStorage::Save() failed";
---- /src/prediction/user_history_predictor.h
-+++ /src/prediction/user_history_predictor.h
-@@ -61,11 +61,15 @@
- class UserHistoryPredictorSyncer;
-
- // Added serialization method for UserHistory.
--class UserHistoryStorage : public mozc::user_history_predictor::UserHistory {
-+class UserHistoryStorage {
- public:
- explicit UserHistoryStorage(const string &filename);
- ~UserHistoryStorage();
-
-+ // Instance of base class generated by Protocol Buffers compiler.
-+ // Regular inheritance strongly discouraged.
-+ mozc::user_history_predictor::UserHistory user_history_base;
-+
- // Loads from encrypted file.
- bool Load();
-
---- /src/prediction/user_history_predictor_test.cc
-+++ /src/prediction/user_history_predictor_test.cc
-@@ -2222,7 +2222,7 @@
-
- UserHistoryStorage storage1(filename);
-
-- UserHistoryPredictor::Entry *entry = storage1.add_entries();
-+ UserHistoryPredictor::Entry *entry = storage1.user_history_base.add_entries();
- CHECK(entry);
- entry->set_key("key");
- entry->set_key("value");
-@@ -2230,7 +2230,7 @@
- UserHistoryStorage storage2(filename);
- storage2.Load();
-
-- EXPECT_EQ(storage1.DebugString(), storage2.DebugString());
-+ EXPECT_EQ(storage1.user_history_base.DebugString(), storage2.user_history_base.DebugString());
- FileUtil::Unlink(filename);
- }
-
---- /src/rewriter/usage_rewriter_test.cc
-+++ /src/rewriter/usage_rewriter_test.cc
-@@ -312,7 +312,7 @@
- // Load mock data
- {
- UserDictionaryStorage storage("");
-- UserDictionaryStorage::UserDictionary *dic = storage.add_dictionaries();
-+ UserDictionaryStorage::UserDictionary *dic = storage.user_dictionary_storage_base.add_dictionaries();
-
- UserDictionaryStorage::UserDictionaryEntry *entry = dic->add_entries();
- entry->set_key("うま");
-@@ -320,7 +320,7 @@
- entry->set_pos(user_dictionary::UserDictionary::NOUN);
- entry->set_comment("アルパカコメント");
-
-- user_dictionary_->Load(storage);
-+ user_dictionary_->Load(storage.user_dictionary_storage_base);
- }
-
- // Emulates the conversion of key="うま".
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index 828d6b1e8d6e..08be8f8c45aa 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-PYTHON_COMPAT=(python{3_6,3_7,3_8})
+PYTHON_COMPAT=(python{3_7,3_8,3_9})
inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
@@ -25,6 +25,7 @@ if [[ "${PV}" == "9999" ]]; then
else
SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.tar.gz
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
+ https://dev.gentoo.org/~juippis/distfiles/tmp/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )"
fi
@@ -111,7 +112,7 @@ src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_4.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+ eapply -p2 "${DISTDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-environmental_variables.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-reiwa.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-server_path_check.patch"
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index 615bd291481a..b93a912f62ea 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-PYTHON_COMPAT=(python{3_6,3_7,3_8})
+PYTHON_COMPAT=(python{3_7,3_8,3_9})
inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
@@ -25,6 +25,7 @@ if [[ "${PV}" == "9999" ]]; then
else
SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.tar.gz
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
+ https://dev.gentoo.org/~juippis/distfiles/tmp/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )"
fi
@@ -111,7 +112,7 @@ src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_4.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+ eapply -p2 "${DISTDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-environmental_variables.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-reiwa.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-server_path_check.patch"