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,7 +366,7 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
currentWord = line_text.substr(currentWordPos.first, currentWordPos.second);
wxMenu menu;
if (spellchecker)
if (spellchecker) {
AddSpellCheckerEntries(menu);
// Append language list
@ -375,6 +375,7 @@ void SubsTextEditCtrl::OnContextMenu(wxContextMenuEvent &event) {
to_wx(OPT_GET("Tool/Spell Checker/Language")->GetString()),
to_wx(spellchecker->GetLanguageList())));
menu.AppendSeparator();
}
AddThesaurusEntries(menu);