Fix crash on right click due to no spell checker

See: #131
This commit is contained in:
scx 2019-09-07 23:38:06 +02:00 committed by Thomas Goyne
parent 0418d0b5be
commit cb0af6ca35
2 changed files with 10 additions and 7 deletions

View file

@ -22,10 +22,12 @@
#include <libaegisub/make_unique.h>
#include <libaegisub/spellchecker.h>
#ifdef __APPLE__
namespace agi {
class OptionValue;
std::unique_ptr<agi::SpellChecker> CreateCocoaSpellChecker(OptionValue *opt);
}
#endif
std::unique_ptr<agi::SpellChecker> SpellCheckerFactory::GetSpellChecker() {
#ifdef __APPLE__

View file

@ -366,15 +366,16 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
currentWord = line_text.substr(currentWordPos.first, currentWordPos.second);
wxMenu menu;
if (spellchecker)
if (spellchecker) {
AddSpellCheckerEntries(menu);
// Append language list
menu.Append(-1,_("Spell checker language"), GetLanguagesMenu(
EDIT_MENU_DIC_LANGS,
to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()),
to_wx(spellchecker->GetLanguageList())));
menu.AppendSeparator();
// Append language list
menu.Append(-1, _("Spell checker language"), GetLanguagesMenu(
EDIT_MENU_DIC_LANGS,
to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()),
to_wx(spellchecker->GetLanguageList())));
menu.AppendSeparator();
}
AddThesaurusEntries(menu);