MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / update_list

Method update_list

src/ui/SelectMultipleLanguagesDialog.cpp:45–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43HWND SelectMultipleLanguagesDialog::get_list_box() { return m_h_lang_list; }
44
45void SelectMultipleLanguagesDialog::update_list() {
46 if (m_h_lang_list == nullptr)
47 return;
48
49 ListBox_ResetContent(m_h_lang_list);
50 auto langs = m_speller_container.get_available_languages();
51 for (auto &lang : langs) {
52 ListBox_AddString(m_h_lang_list, lang.alias_name.c_str ());
53 }
54
55 CheckedListBox_EnableCheckAll(get_lang_list()->get_list_box(), BST_UNCHECKED);
56 for (auto &token : make_delimiter_tokenizer(m_settings.get_active_multi_languages(), LR"(\|)").get_all_tokens()) {
57 int index = -1;
58 int i = 0;
59 for (auto &lang : langs) {
60 if (token == lang.orig_name) {
61 index = i;
62 break;
63 }
64 ++i;
65 }
66 if (index != -1)
67 CheckedListBox_SetCheckState(m_h_lang_list, index, BST_CHECKED);
68 }
69}
70
71void SelectMultipleLanguagesDialog::apply() {
72 int count = ListBox_GetCount(m_h_lang_list);

Callers

nothing calls this directly

Calls 6

get_lang_listFunction · 0.85
make_delimiter_tokenizerFunction · 0.85
c_strMethod · 0.80
get_all_tokensMethod · 0.80
get_list_boxMethod · 0.45

Tested by

no test coverage detected