Skip to content

Commit

Permalink
Do not call CoInitialize unless native speller was used (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
Predelnik authored Aug 20, 2023
1 parent 3d522d2 commit 9c89295
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/spellers/SpellerContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ void SpellerContainer::add_to_dictionary(std::wstring wstr) {
SpellerContainer::SpellerContainer(const Settings *settings, const NppData *npp_data)
: m_settings(*settings) {
init_spellers(*npp_data);
m_native_speller->init(); // just to allow checking if it's available or not
m_settings.settings_changed.connect([this] { on_settings_changed(); });
}

Expand Down
10 changes: 0 additions & 10 deletions src/ui/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,15 +814,6 @@ void SimpleSettingsTab::update_controls(const Settings &settings, const SpellerC
Button_SetCheck(m_h_select_misspelled_on_menu_cb, settings.data.select_word_on_context_menu_click);
}

void SimpleSettingsTab::init_speller_id_combobox(const SpellerContainer &speller_container) {
m_speller_cmb.clear();
for (auto id : enum_range<SpellerId>()) {
if (id == SpellerId::native && !speller_container.native_speller().is_working())
continue;
m_speller_cmb.add_item(id);
}
}

void SettingsDialog::update_rect_offset_due_to_buttons(RECT &rc) {
auto ok_hwnd = GetDlgItem(_hSelf, IDOK);
RECT ok_rect;
Expand All @@ -842,7 +833,6 @@ INT_PTR SettingsDialog::run_dlg_proc(UINT message, WPARAM w_param, LPARAM l_para

m_simple_dlg.init_settings(_hInst, _hSelf);
m_simple_dlg.create(IDD_SIMPLE, false, false);
m_simple_dlg.init_speller_id_combobox(m_speller_container);
m_simple_dlg.display();
m_advanced_dlg.init(_hInst, _hSelf);
m_advanced_dlg.create(IDD_ADVANCED, false, false);
Expand Down

0 comments on commit 9c89295

Please sign in to comment.