]> git.lyx.org Git - features.git/commitdiff
Fix crash when reconfigure is called without Buffer nor BufferView.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 1 Nov 2006 13:14:21 +0000 (13:14 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 1 Nov 2006 13:14:21 +0000 (13:14 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15661 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyx_cb.C
src/lyx_cb.h
src/lyxfunc.C

index 4ca5a5a0ff4fd6e51bb10c3ab100e593c3d5a456..d61ebf3d1bf7eb3359fa37ecf86846bc9de0ca58 100644 (file)
@@ -34,6 +34,7 @@
 #include "frontends/Alert.h"
 #include "frontends/Application.h"
 #include "frontends/FileDialog.h"
+#include "frontends/LyXView.h"
 
 #include "support/filefilterlist.h"
 #include "support/filetools.h"
@@ -404,10 +405,10 @@ string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagrap
 
 // This function runs "configure" and then rereads lyx.defaults to
 // reconfigure the automatic settings.
-void reconfigure(BufferView * bv)
+void reconfigure(LyXView & lv)
 {
        // emit message signal.
-       bv->buffer()->message(_("Running configure..."));
+       lv.message(_("Running configure..."));
 
        // Run configure in user lyx directory
        support::Path p(package().user_support());
@@ -416,7 +417,7 @@ void reconfigure(BufferView * bv)
        one.startscript(Systemcall::Wait, configure_command);
        p.pop();
        // emit message signal.
-       bv->buffer()->message(_("Reloading configuration..."));
+       lv.message(_("Reloading configuration..."));
        lyxrc.read(libFileSearch(string(), "lyxrc.defaults"));
        // Re-read packages.lst
        LaTeXFeatures::getAvailable();
index 246799d26ca8ed790efc12f304ed97cd78f32773..da520d82b1edc0ae6c1fb08c97c7c9d2c561925f 100644 (file)
@@ -18,6 +18,7 @@ namespace lyx {
 
 class Buffer;
 class BufferView;
+class LyXView;
 
 ///
 extern bool quitting;
@@ -35,7 +36,7 @@ void insertAsciiFile(BufferView * bv, std::string const & f, bool asParagraph);
 ///
 std::string getContentsOfAsciiFile(BufferView * bv, std::string const & f, bool asParagraph);
 ///
-void reconfigure(BufferView * bv);
+void reconfigure(LyXView & lv);
 
 } // namespace lyx
 
index 3c1a0f8a6a1442aa76f8b736dd6486691afeaa1e..c56556c2fd805337d2f25d56316ebb68594817fc 100644 (file)
@@ -1055,7 +1055,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        break;
 
                case LFUN_RECONFIGURE:
-                       reconfigure(view());
+                       BOOST_ASSERT(lyx_view_);
+                       reconfigure(*lyx_view_);
                        break;
 
                case LFUN_HELP_OPEN: {