]> git.lyx.org Git - lyx.git/blobdiff - src/LyX.cpp
Make the fake sequence for braces highly unlikely (addressing #6478).
[lyx.git] / src / LyX.cpp
index e2e5b0c925a9ab378eafcebc947449a845c0a93a..510bef47e4c2fc250ae55dddf61b007e3b89cd04 100644 (file)
@@ -25,6 +25,7 @@
 #include "ConverterCache.h"
 #include "Converter.h"
 #include "CutAndPaste.h"
+#include "EnchantChecker.h"
 #include "Encoding.h"
 #include "ErrorList.h"
 #include "Format.h"
@@ -122,7 +123,7 @@ void reconfigureUserLyXDir()
 /// The main application class private implementation.
 struct LyX::Impl
 {
-       Impl() : spell_checker_(0), aspell_checker_(0), hunspell_checker_(0)
+       Impl() : spell_checker_(0), aspell_checker_(0), enchant_checker_(0), hunspell_checker_(0)
        {
                // Set the default User Interface language as soon as possible.
                // The language used will be derived from the environment
@@ -133,6 +134,7 @@ struct LyX::Impl
        ~Impl()
        {
                delete aspell_checker_;
+               delete enchant_checker_;
                delete hunspell_checker_;
        }
 
@@ -182,6 +184,8 @@ struct LyX::Impl
        ///
        SpellChecker * aspell_checker_;
        ///
+       SpellChecker * enchant_checker_;
+       ///
        SpellChecker * hunspell_checker_;
 };
 
@@ -750,7 +754,7 @@ bool LyX::init()
        if (!LyXSetStyle())
                return false;
        //...and the modules
-       moduleList.read();
+       theModuleList.read();
 
        // read keymap and ui files in batch mode as well
        // because InsetInfo needs to know these to produce
@@ -765,8 +769,6 @@ bool LyX::init()
        // load user bind file user.bind
        pimpl_->toplevel_keymap_.read("user", 0, KeyMap::MissingOK);
 
-       pimpl_->lyxfunc_.initKeySequences(&pimpl_->toplevel_keymap_);
-
        if (lyxerr.debugging(Debug::LYXRC))
                lyxrc.print();
 
@@ -959,7 +961,7 @@ int parse_dbg(string const & arg, string const &, string &)
        }
        lyxerr << to_utf8(bformat(_("Setting debug level to %1$s"), from_utf8(arg))) << endl;
 
-       lyxerr.level(Debug::value(arg));
+       lyxerr.setLevel(Debug::value(arg));
        Debug::showLevel(lyxerr, lyxerr.level());
        return 1;
 }
@@ -1156,6 +1158,13 @@ void dispatch(FuncRequest const & action)
 }
 
 
+void dispatch(FuncRequest const & action, DispatchResult & dr)
+{
+       LASSERT(singleton_, /**/);
+       singleton_->pimpl_->lyxfunc_.dispatch(action, dr);
+}
+
+
 BufferList & theBufferList()
 {
        LASSERT(singleton_, /**/);
@@ -1290,6 +1299,14 @@ void setSpellChecker()
                return;
        }
 #endif
+#if defined(USE_ENCHANT)
+       if (lyxrc.spellchecker == "enchant") {
+               if (!singleton_->pimpl_->enchant_checker_)
+                       singleton_->pimpl_->enchant_checker_ = new EnchantChecker();
+               singleton_->pimpl_->spell_checker_ = singleton_->pimpl_->enchant_checker_;
+               return;
+       }
+#endif
 #if defined(USE_HUNSPELL)
        if (lyxrc.spellchecker == "hunspell") {
                if (!singleton_->pimpl_->hunspell_checker_)