]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
Revert 23154.
[lyx.git] / src / LyXFunc.cpp
index 13b5c091ffc72f99d8db02573f6d029170f31fe2..95ff83dc53d5816c4c3fbddd831e15b7291e6ebb 100644 (file)
@@ -379,7 +379,8 @@ void LyXFunc::processKeySym(KeySymbol const & keysym, KeyModifier state)
                        lyx_view_->updateCompletion(false, false);
        }
 
-       lyx_view_->restartCursor();
+       if (lyx_view_)
+               lyx_view_->restartCursor();
 }
 
 
@@ -711,7 +712,7 @@ void showPrintError(string const & name)
 }
 
 
-void loadTextClass(string const & name)
+void loadTextClass(string const & name, string const & buf_path)
 {
        pair<bool, textclass_type> const tc_pair =
                textclasslist.numberOfClass(name);
@@ -725,7 +726,7 @@ void loadTextClass(string const & name)
 
        textclass_type const tc = tc_pair.second;
 
-       if (!textclasslist[tc].load()) {
+       if (!textclasslist[tc].load(buf_path)) {
                docstring s = bformat(_("The document class %1$s."
                                   "could not be loaded."),
                                   from_utf8(textclasslist[tc].name()));
@@ -1604,7 +1605,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        BOOST_ASSERT(lyx_view_);
                        Buffer * buffer = lyx_view_->buffer();
 
-                       loadTextClass(argument);
+                       loadTextClass(argument, buffer->filePath());
 
                        pair<bool, textclass_type> const tc_pair =
                                textclasslist.numberOfClass(argument);
@@ -1643,7 +1644,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                }
 
                case LFUN_TEXTCLASS_LOAD:
-                       loadTextClass(argument);
+                       loadTextClass(argument, lyx_view_->buffer()->filePath());
                        break;
 
                case LFUN_LYXRC_APPLY: {