]> git.lyx.org Git - lyx.git/blobdiff - src/AspellChecker.cpp
GuiBox.cpp: fix #6721
[lyx.git] / src / AspellChecker.cpp
index 71475544a4f8cc79b6cb7e1984277f0905e736d0..a7a1d2977a0611ef0118c9a42e4e1fafeadfca6b 100644 (file)
@@ -91,15 +91,31 @@ AspellConfig * getConfig()
        AspellConfig * config = new_aspell_config();
 #ifdef __APPLE__
        char buf[2048] ;
+       bool have_dict = false;
+#ifdef ASPELL_FRAMEWORK
+       char * framework = ASPELL_FRAMEWORK ;
 
-       if ( getPrivateFrameworkPathName(buf, sizeof(buf), "Aspell.framework") ) {
+       if ( strlen(framework) && getPrivateFrameworkPathName(buf, sizeof(buf), framework) ) {
                lyx::support::FileName const base(buf);
-               lyx::support::FileName const data(base.absFilename() + "/lib/aspell-0.60");
-               lyx::support::FileName const dict(base.absFilename() + "/share/aspell");
+               lyx::support::FileName const data(base.absFileName() + "/Resources/data");
+               lyx::support::FileName const dict(base.absFileName() + "/Resources/dict");
                LYXERR(Debug::FILES, "aspell bundle path: " << buf);
-               if (dict.isDirectory() && data.isDirectory()) {
-                       aspell_config_replace(config, "dict-dir", dict.absFilename().c_str());
-                       aspell_config_replace(config, "data-dir", data.absFilename().c_str());
+               have_dict = dict.isDirectory() && data.isDirectory();
+               if (have_dict) {
+                       aspell_config_replace(config, "dict-dir", dict.absFileName().c_str());
+                       aspell_config_replace(config, "data-dir", data.absFileName().c_str());
+                       LYXERR(Debug::FILES, "aspell dict: " << dict);
+               }
+       }
+#endif
+       if ( !have_dict ) {
+               lyx::support::FileName const base("/opt/local"); // check for mac-ports data
+               lyx::support::FileName const data(base.absFileName() + "/lib/aspell-0.60");
+               lyx::support::FileName const dict(base.absFileName() + "/share/aspell");
+               have_dict = dict.isDirectory() && data.isDirectory();
+               if (have_dict) {
+                       aspell_config_replace(config, "dict-dir", dict.absFileName().c_str());
+                       aspell_config_replace(config, "data-dir", data.absFileName().c_str());
                        LYXERR(Debug::FILES, "aspell dict: " << dict);
                }
        }